Code Templates – MbUnit testing
October 29th, 2012
A list of code templates specific to the MbUnit unit test framework. The meaning of the text commands in bold can be seen in the corresponding topic.
Template | Expansion |
fsu | [FixtureSetUp] public void FixtureSetUp() { «Caret»«Marker» } |
ftd | [FixtureTearDown] public void FixtureTearDown() { «Caret»«Marker» } |
tc | [TestFixture] public class «Caret»«Field(TestFixture)»«BlockAnchor» { [Test] public void «Field(TestMethod)»() { «Marker»«FinalTarget» } } |
tf | [TestFixture] public class «Caret»«Field(TestFixture)»«BlockAnchor» { [Test] public void «Field(TestMethod)»() { «Marker»«FinalTarget» } } |
tm | [Test] public void «Caret»«Field(TestMethod)»«BlockAnchor»() { «Marker»«FinalTarget» } |
tsu | [SetUp] public void SetUp() { «Caret»«Marker» } |
ttd | [TearDown] public void TearDown() { «Caret»«Marker» } |
Asserts
Template | Expansion |
aae | Assert.AreApproximatelyEqual(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue, The actual value)», «Field(delta,The inclusive delta between the values)»);«FinalTarget» |
ab | Assert.Between(«Caret» «Field(actualValue,The actual value)»«BlockAnchor», «Field(minimum, Inclusive minimum value)», «Field(maximum,Inclusive maximum value)») |
abd | Assert.BinaryDeserialize<«Caret» «Field(T)»«BlockAnchor»>(«Field(stream)»);«FinalTarget» |
abs | Assert.BinarySerialize(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
abstd | Assert.BinarySerializeThenDeserialize<«Caret» «Field(T)»«BlockAnchor»>(«Field(value)»);«FinalTarget» |
ac | Assert.Contains( «Field(enumeration, The enumeration of items)», «Caret»«Field(expected, The expected value expected to be found in the collection)»«BlockAnchor») |
ack | Assert.ContainsKey(«Caret»«Field(dictionary,The dictionary of items)»«BlockAnchor», «Field(expectedKey, The key expected to be found in the dictionary)»);«FinalTarget» |
ad | Assert.Distinct(«Caret»«Field(values,The sequence of values to be tested)»«BlockAnchor»);«FinalTarget» |
adnc/anc | Assert.DoesNotContain(«Field(enumeration, The enumeration of items)», «Caret»«Field(expected, The expected value expected to be found in the collection)»«BlockAnchor») |
adnck/anck | Assert.DoesNotContainKey(«Caret»«Field(dictionary,The dictionary of items)»«BlockAnchor», «Field(expectedKey, The key expected to be found in the dictionary)»);«FinalTarget» |
adnt | Assert.DoesNotThrow(«Caret»«Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
ae | Assert.AreEqual(«Caret»«Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
aee | Assert.AreElementsEqual(«Caret» «Field(expectedSequence,The expected sequence)»«BlockAnchor», «Field(actualSequence,The actual sequence)»); |
aeeio | Assert.AreElementsEqualIgnoringOrder(«Caret» «Field(expectedSequence,The expected sequence)»«BlockAnchor», «Field(actualSequence,The actual sequence)»); |
aene | Assert.AreElementsNotEqual(«Caret» «Field(expectedSequence,The expected sequence)»«BlockAnchor», «Field(actualSequence,The actual sequence)»); |
aew | Assert.EndsWith(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
aex | Assert.Exists(«Field(values,The sequence of values to evaluate)», «Caret»«Field(predicate,The condition that must be fulfilled (returns true) by at least one element of the sequence)»«BlockAnchor»); |
afa | Assert.ForAll(«Field(values,The sequence of values to evaluate)», «Caret»«Field(predicate,The condition that must be fulfilled (returns true) by at least one element of the sequence)»«BlockAnchor»); |
afl | Assert.Fail();«Caret» |
afm | Assert.FullMatch(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
agt | Assert.GreaterThan(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
agtoet | Assert.GtreaterThanOrEqualTo(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
aiaf | Assert.IsAssignableFrom(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
aie | Assert.IsEmpty(«Caret» «Field(values,The sequence of values to be tested)»«BlockAnchor»);«FinalTarget» |
aif | Assert.IsFalse(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
aiiot | Assert.IsInstanceOfType(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
ain | Assert.IsNull(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
aine | Assert.IsNotEmpty(«Caret» «Field(values,The sequence of values to be tested)»«BlockAnchor»);«FinalTarget» |
ainiot | Assert.IsNotInstanceOfType(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
ainn | Assert.IsNotNull(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
aisnaf | Assert.IsNotAssignableFrom(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
alt | Assert.LessThan(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
altoet | Assert.GtreaterThanOrEqualTo(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
anae | Assert.AreNotApproximatelyEqual(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue, The actual value)», «Field(delta,The inclusive delta between the values)»); |
anb | Assert.NotBetween(«Caret» «Field(actualValue,The actual value)»«BlockAnchor», «Field(minimum, Inclusive minimum value)», «Field(maximum,Inclusive maximum value)») |
ane | Assert.AreNotEqual(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
ans | Assert.AreNotSame(«Caret» «Field(expectedValue,The expected value)»«BlockAnchor», «Field(actualValue,The actual value)»); |
as | Assert.AreSame |
axd | Assert.XmlDeserialize<«Caret» «Field(T)»«BlockAnchor»>(«Field(stream)»);«FinalTarget» |
axs | Assert.BinarySerialize(«Caret» «Field(value,The actual value)»«BlockAnchor»);«FinalTarget» |
axstd | Assert.BinarySerializeThenDeserialize<«Caret» «Field(T)»«BlockAnchor»>(«Field(value)»);«FinalTarget» |
Attributes
Template | Expansion |
[a | [Annotation(«Caret» «Field(type,The annotation type)»«BlockAnchor»,«Field(message,The annotation message)»)«?OneTrailing(])» |
[af | [AssemblyFixture«?OneTrailing(])» |
[ar | [AssemblyResolver«Caret» «Field(assemblyResolverType,The assembly resolver type)»«BlockAnchor»«?OneTrailing(])» |
[as | [ApartmentState(«Caret» «Field(apartmentState,The apartment state to use)»«BlockAnchor»«?OneTrailing(])» |
[au | [Author(«Caret» «Field(name,The author’s name)»«BlockAnchor», «Field(email,The author’s email address)», «Field(homepage,The author’s home page)»)«?OneTrailing(])» |
[b | [Bind(«Caret» «Field(path,The binding path)»«BlockAnchor»)«?OneTrailing(])» |
)» | |
[cj | [CombinatorialJoin«?OneTrailing(])» |
[co | [Column(«Caret» «Field(values,The array of values in the column)»«BlockAnchor»)«?OneTrailing(])» |
[con | [Content«?OneTrailing(])» |
[csv | [CsvData«?OneTrailing(])» |
[da | [Data«?OneTrailing(])» |
[de | [Description(«Caret» «Field(description,The description to associate)»«BlockAnchor»)«?OneTrailing(])» |
[do | [DependsOn(«Caret» «Field(testFixtureType,The dependent test fixture type)»«BlockAnchor», «Field(testMethodName,The dependent test method name)»)«?OneTrailing(])» |
[dop | [DegreeOfParallelism(«Caret» «Field(degreeOfParallelism,The degree of parallelism)»«BlockAnchor»)«?OneTrailing(])» |
[dtct | [DefaultTestCaseTimeout(«Caret» «Field(timeoutSeconds,The timeout in seconds, or zero if none.)»«BlockAnchor»)«?OneTrailing(])» |
[dtf | [DynamicTestFactory«?OneTrailing(])» |
[e | [Explicit(«Caret» «Field(reason,The reason for which the test should be run explicitly)»«BlockAnchor»)«?OneTrailing(])» |
[eane | [ExpectedArgumentNullExeption(«Caret» «Field(message,The expected exception message)»«BlockAnchor»)«?OneTrailing(])» |
[eaoore | [ExpectedArgumentOutOfRangeException(«Caret» «Field(message,The expected exception message)»«BlockAnchor»)«?OneTrailing(])» |
[ed | [EnumData(«Caret»«Field(type,The type of the enumeration)»«BlockAnchor»)«?OneTrailing(])» |
[ee | [ExpectedException(«Caret» «Field(message,The expected exception message)»«BlockAnchor»)«?OneTrailing(])» |
[f | [Factory(«Caret» «Field(type,The declaring type of the fact)»«BlockAnchor», «Field(memberName,The factory member name)»)«?OneTrailing(])» |
[fi | [FixtureInitializer«?OneTrailing(])» |
[fsu | [FixtureSetUp«?OneTrailing(])» |
[ftd | [FixtureTearDown«?OneTrailing(])» |
[h | [Header(«Caret» «Field(firstColumnName,The name of the first column)»«BlockAnchor», «FinalTarget»)«?OneTrailing(])» |
[i | [Ignore(«Caret» «Field(reason,The reason for which the test is to be ignored)»«BlockAnchor»)«?OneTrailing(])» |
[impe | [Impersonate«?OneTrailing(])» |
[impo | [Importance(«Caret» «Field(importance,The importance to associate)»«BlockAnchor»)«?OneTrailing(])» |
[j | [Join«?OneTrailing(])» |
[md | [MetaData(«Caret» «Field(metadataKey,The metadata key)»«BlockAnchor», «Field(metadataValue,metadataValue)»)«?OneTrailing(])» |
Namespaces
Template |
Expansion |
umbc/umbuc/umc/umuc | using MbUnit.Core; |
umbf/umbuf/umf/umuf | using MbUnit.Framework; |
umbfcv/umbufcv/umfcv/umufcv | using MbUnit.Framework.ContractVerifiers; |
umbfx/umbufx/umfx/umufx | using MbUnit.Framework.Xml; |