ITestAdaptor.cs
3.93 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
/// <summary>
/// ```ITestAdaptor``` is a representation of a node in the test tree implemented as a wrapper around the [NUnit](http://www.nunit.org/) [ITest](https://github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/Interfaces/ITest.cs) interface.
/// </summary>
public interface ITestAdaptor
{
/// <summary>
/// The ID of the test tree node. The ID can change if you add new tests to the suite. Use UniqueName, if you want to have a more permanent point of reference.
/// </summary>
string Id { get; }
/// <summary>
/// The name of the test. E.g.,```MyTest```.
/// </summary>
string Name { get; }
/// <summary>
/// The full name of the test. E.g., ```MyNamespace.MyTestClass.MyTest```.
/// </summary>
string FullName { get; }
/// <summary>
/// The total number of test cases in the node and all sub-nodes.
/// </summary>
int TestCaseCount { get; }
/// <summary>
/// Whether the node has any children.
/// </summary>
bool HasChildren { get; }
/// <summary>
/// True if the node is a test suite/fixture, false otherwise.
/// </summary>
bool IsSuite { get; }
/// <summary>
/// The child nodes.
/// </summary>
IEnumerable<ITestAdaptor> Children { get; }
/// <summary>
/// The parent node, if any.
/// </summary>
ITestAdaptor Parent { get; }
/// <summary>
/// The test case timeout in milliseconds. Note that this value is only available on TestFinished.
/// </summary>
int TestCaseTimeout { get; }
/// <summary>
/// The type of test class as an ```NUnit``` <see cref="ITypeInfo"/>. If the node is not a test class, then the value is null.
/// </summary>
ITypeInfo TypeInfo { get; }
/// <summary>
/// The Nunit <see cref="IMethodInfo"/> of the test method. If the node is not a test method, then the value is null.
/// </summary>
IMethodInfo Method { get; }
/// <summary>
/// An array of the categories applied to the test or fixture.
/// </summary>
string[] Categories { get; }
/// <summary>
/// Returns true if the node represents a test assembly, false otherwise.
/// </summary>
bool IsTestAssembly { get; }
/// <summary>
/// The run state of the test node. Either ```NotRunnable```, ```Runnable```, ```Explicit```, ```Skipped```, or ```Ignored```.
/// </summary>
RunState RunState { get; }
/// <summary>
/// The description of the test.
/// </summary>
string Description { get; }
/// <summary>
/// The skip reason. E.g., if ignoring the test.
/// </summary>
string SkipReason { get; }
/// <summary>
/// The ID of the parent node.
/// </summary>
string ParentId { get; }
/// <summary>
/// The full name of the parent node.
/// </summary>
string ParentFullName { get; }
/// <summary>
/// A unique generated name for the test node. E.g., ```Tests.dll/MyNamespace/MyTestClass/[Tests][MyNamespace.MyTestClass.MyTest]```.
/// </summary>
string UniqueName { get; }
/// <summary>
/// A unique name of the parent node. E.g., ```Tests.dll/MyNamespace/[Tests][MyNamespace.MyTestClass][suite]```.
/// </summary>
string ParentUniqueName { get; }
/// <summary>
/// The child index of the node in its parent.
/// </summary>
int ChildIndex { get; }
/// <summary>
/// The mode of the test. Either **Edit Mode** or **Play Mode**.
/// </summary>
TestMode TestMode { get; }
}
}