Creates the execution logic
Namespace: MbUnit.Framework
Assembly: MbUnit.Framework (in MbUnit.Framework.dll)
Syntax
Remarks
See summary.
Examples
This example shows the squeleton of a fixture tests the IDictionary interface, the fixture implements the Type Test pattern.
The tested instances are feeded by the methods tagged with the ProviderAttribute. These methods must return an instance that is assignable with IDictionary. Subsequent will receive the created instance as parameter.
[TypeFixture(typeof(IDictionary),"IDictionary interface fixture")]
public void DictionaryTest
{
[Provider(typeof(Hashtable))]
public Hashtable ProvideHashtable()
{
return new Hashtable();
}
[Provider(typeof(SortedList))]
public SortedList ProvideSortedList()
{
return new SortedList();
}
// tests
[Test]
[ExpectedException(typeof(ArgumentException))]
public void AddDuplicate(IDictionary dic) // dic comes from a provider class
{
dic.Add("key",null);
dic.Add("key",null); // boom
}
}
| |
See Also
TypeFixtureAttribute Class
MbUnit.Framework Namespace