Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TestDecorator.cs « NUnitCore « src « nunit « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: eded1c24ba5e796c61634fda6fe9a1af5da02a48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
namespace NUnit.Extensions 
{
	using System;
	using NUnit.Framework;

	/// <summary>A Decorator for Tests.</summary>
	/// <remarks>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.</remarks>
	public class TestDecorator: Assertion, ITest 
	{
		/// <summary>
		/// A reference to the test that is being decorated
		/// </summary>
		protected readonly ITest fTest;
		/// <summary>
		/// Creates a decorator for the supplied test
		/// </summary>
		/// <param name="test">The test to be decorated</param>
		public TestDecorator(ITest test) 
		{
			if(test!= null)
			{
				this.fTest= test;
			}
			else
				throw new ArgumentNullException("test");
		}
    	/// <summary>
		/// 
		/// </summary>
		/// <param name="result"></param>
		public virtual void Run(TestResult result) 
		{
			this.BasicRun(result);
		}
		/// <summary>The basic run behaviour.</summary>
		public void BasicRun(TestResult result) 
		{
			this.fTest.Run(result);
		}
		/// <summary>
		/// 
		/// </summary>
		public virtual int CountTestCases 
		{
			get { return fTest.CountTestCases; }
		}
		/// <summary>
		/// 
		/// </summary>
		public ITest GetTest 
		{
			get { return fTest; }
		}
		//public string Name
		//{
		//	get{return fTest.Name;}
		//}
		
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public override string ToString() 
		{
			return fTest.ToString();
		}
	}
}