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: 0275391235037fc8ac89fbc8bacb7ec7a8961069 (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
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>
  /// 
  /// </summary>
    protected readonly ITest fTest;
    /// <summary>
    /// 
    /// </summary>
    /// <param name="test"></param>
    public TestDecorator(ITest test) {
      fTest= test;
    }
    
    /// <summary>The basic run behaviour.</summary>
    public void BasicRun(TestResult result) {
      fTest.Run(result);
    }
	  /// <summary>
	  /// 
	  /// </summary>
    public virtual int CountTestCases {
      get { return fTest.CountTestCases; }
    }
  /// <summary>
  /// 
  /// </summary>
    public ITest GetTest {
      get { return fTest; }
    }
	  /// <summary>
	  /// 
	  /// </summary>
	  /// <param name="result"></param>
    public virtual void Run(TestResult result) {
      BasicRun(result);
    }
	  /// <summary>
	  /// 
	  /// </summary>
	  /// <returns></returns>
    public override string ToString() {
      return fTest.ToString();
    }
  }
}