1 // ***********************************************************************
2 // Copyright (c) 2007-2015 Charlie Poole
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 // ***********************************************************************
25 #define NUNIT_FRAMEWORK
31 namespace NUnit.Framework.Interfaces
34 /// Common interface supported by all representations
35 /// of a test. Only includes informational fields.
36 /// The Run method is specifically excluded to allow
37 /// for data-only representations of a test.
39 public interface ITest : IXmlNodeBuilder
42 /// Gets the id of the test
47 /// Gets the name of the test
52 /// Gets the fully qualified name of the test
54 string FullName { get; }
57 /// Gets the name of the class containing this test. Returns
58 /// null if the test is not associated with a class.
60 string ClassName { get; }
63 /// Gets the name of the method implementing this test.
64 /// Returns null if the test is not implemented as a method.
66 string MethodName { get; }
69 /// Gets the Type of the test fixture, if applicable, or
70 /// null if no fixture type is associated with this test.
72 ITypeInfo TypeInfo { get; }
75 /// Gets an IMethod for the method implementing this test.
76 /// Returns null if the test is not implemented as a method.
78 IMethodInfo Method { get; }
81 /// Gets the RunState of the test, indicating whether it can be run.
83 RunState RunState { get; }
86 /// Count of the test cases ( 1 if this is a test case )
88 int TestCaseCount { get; }
91 /// Gets the properties of the test
93 IPropertyBag Properties { get; }
96 /// Gets the parent test, if any.
98 /// <value>The parent test or null if none exists.</value>
102 /// Returns true if this is a test suite
104 bool IsSuite { get; }
107 /// Gets a bool indicating whether the current test
108 /// has any descendant tests.
110 bool HasChildren { get; }
113 /// Gets this test's child tests
115 /// <value>A list of child tests</value>
116 System.Collections.Generic.IList<ITest> Tests { get; }
119 /// Gets a fixture object for running this test.
121 object Fixture { get; }