namespace NUnit.Extensions { using System; using NUnit.Framework; /// A Decorator for Tests. /// Use TestDecorator as the base class /// for defining new test decorators. TestDecorator subclasses /// can be introduced to add behaviour before or after a test /// is run. public class TestDecorator: Assertion, ITest { /// /// A reference to the test that is being decorated /// protected readonly ITest fTest; /// /// Creates a decorator for the supplied test /// /// The test to be decorated public TestDecorator(ITest test) { if(test!= null) { this.fTest= test; } else throw new ArgumentNullException("test"); } /// /// /// /// public virtual void Run(TestResult result) { this.BasicRun(result); } /// The basic run behaviour. public void BasicRun(TestResult result) { this.fTest.Run(result); } /// /// /// public virtual int CountTestCases { get { return fTest.CountTestCases; } } /// /// /// public ITest GetTest { get { return fTest; } } //public string Name //{ // get{return fTest.Name;} //} /// /// /// /// public override string ToString() { return fTest.ToString(); } } }