2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / nunit24 / NUnitCore / interfaces / ITest.cs
blob6a4a5b2241165b64688895c73cde21a834d913b6
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/?p=license&r=2.4.
5 // ****************************************************************
7 using System.Collections;
9 namespace NUnit.Core
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
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; }
26 /// <summary>
27 /// Gets a string representing the type of test, e.g.: "Test Case"
28 /// </summary>
29 string TestType { get; }
31 /// <summary>
32 /// Indicates whether the test can be run using
33 /// the RunState enum.
34 /// </summary>
35 RunState RunState { get; set; }
37 /// <summary>
38 /// Reason for not running the test, if applicable
39 /// </summary>
40 string IgnoreReason { get; set; }
42 /// <summary>
43 /// Count of the test cases ( 1 if this is a test case )
44 /// </summary>
45 int TestCount { get; }
47 /// <summary>
48 /// Categories available for this test
49 /// </summary>
50 IList Categories { get; }
52 /// <summary>
53 /// Return the description field.
54 /// </summary>
55 string Description { get; set; }
57 /// <summary>
58 /// Return additional properties of the test
59 /// </summary>
60 IDictionary Properties { get; }
62 /// <summary>
63 /// True if this is a suite
64 /// </summary>
65 bool IsSuite { get; }
67 /// <summary>
68 /// Gets the parent test of this test
69 /// </summary>
70 ITest Parent { get; }
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
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