PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/interfaces/ITest.cs

#
C# | 91 lines | 23 code | 14 blank | 54 comment | 0 complexity | 232553aa702fdf0667da6f980e4e2799 MD5 | raw file
 1// ****************************************************************
 2// This is free software licensed under the NUnit license. You
 3// may obtain a copy of the license as well as information regarding
 4// copyright ownership at http://nunit.org.
 5// ****************************************************************
 6
 7using System.Collections;
 8
 9namespace NUnit.Core
10{
11	/// <summary>
12	/// Common interface supported by all representations
13	/// of a test. Only includes informational fields.
14	/// The Run method is specifically excluded to allow
15	/// for data-only representations of a test.
16	/// </summary>
17	public interface ITest
18    {
19        #region Properties
20        /// <summary>
21		/// Gets the completely specified name of the test
22		/// encapsulated in a TestName object.
23		/// </summary>
24		TestName TestName { get; }
25
26		/// <summary>
27		/// Gets a string representing the type of test, e.g.: "Test Case"
28		/// </summary>
29		string TestType { get; }
30
31        /// <summary>
32        /// Indicates whether the test can be run using
33        /// the RunState enum.
34        /// </summary>
35		RunState RunState { get; set; }
36
37		/// <summary>
38		/// Reason for not running the test, if applicable
39		/// </summary>
40		string IgnoreReason { get; set; }
41		
42		/// <summary>
43		/// Count of the test cases ( 1 if this is a test case )
44		/// </summary>
45		int TestCount { get; }
46
47		/// <summary>
48		/// Categories available for this test
49		/// </summary>
50		IList Categories { get; }
51
52		/// <summary>
53		/// Return the description field. 
54		/// </summary>
55		string Description { get; set; }
56
57		/// <summary>
58		/// Return additional properties of the test
59		/// </summary>
60		IDictionary Properties { get; }
61
62		/// <summary>
63		/// True if this is a suite
64		/// </summary>
65		bool IsSuite { get; }
66
67		/// <summary>
68		///  Gets the parent test of this test
69		/// </summary>
70		ITest Parent { get; }
71
72		/// <summary>
73		/// For a test suite, the child tests or suites
74		/// Null if this is not a test suite
75		/// </summary>
76		IList Tests { get; }
77        #endregion
78
79        #region Methods
80		/// <summary>
81		/// Count the test cases that pass a filter. The
82		/// result should match those that would execute
83		/// when passing the same filter to Run.
84		/// </summary>
85		/// <param name="filter">The filter to apply</param>
86		/// <returns>The count of test cases</returns>
87        int CountTestCases(ITestFilter filter);
88        #endregion
89    }
90}
91