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