Creates the execution logic

Namespace: MbUnit.Framework
Assembly:  MbUnit.Framework (in MbUnit.Framework.dll)

Syntax

         
 C#  Visual Basic  Visual C++ 
public override IRun GetRun()
Public Overrides Function GetRun As IRun
public:
virtual IRun^ GetRun() override

Return Value

A IRun instance that represent the type test logic.

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.

Copy imageCopy Code
[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