ITestResultAdaptor.cs
4.11 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
/// <summary>
/// The `ITestResultAdaptor` is the representation of the test results for 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/ITestResults.cs) interface.
/// </summary>
public interface ITestResultAdaptor
{
/// <summary>
/// The test details of the test result tree node as a <see cref="TestAdaptor"/>
/// </summary>
ITestAdaptor Test { get; }
///<summary>
///The name of the test node.
///</summary>
string Name { get; }
/// <summary>
/// Gets the full name of the test result
/// </summary>
///<returns>
///The name of the test result.
///</returns>
string FullName { get; }
///<summary>
///Gets the state of the result as a string.
///</summary>
///<returns>
///It returns one of these values: `Success`, `Skipped`, `Failure`, `Explicit`, `Cancelled`
///</returns>
string ResultState { get; }
///<summary>
///Gets the status of the test as an enum.
///</summary>
///<returns>
///It returns one of these values:`Inconclusive`, `Skipped`, `Passed`, or `Failed`
///</returns>
TestStatus TestStatus { get; }
/// <summary>
/// Gets the elapsed time for running the test in seconds
/// </summary>
/// <returns>
/// Time in seconds.
/// </returns>
double Duration { get; }
/// <summary>
/// Gets or sets the time the test started running.
/// </summary>
///<returns>
///A DataTime object.
///</returns>
DateTime StartTime { get; }
///<summary>
///Gets or sets the time the test finished running.
///</summary>
///<returns>
///A DataTime object.
///</returns>
DateTime EndTime { get; }
/// <summary>
/// The message associated with a test failure or with not running the test
/// </summary>
string Message { get; }
/// <summary>
/// Any stacktrace associated with an error or failure. Not available in the Compact Framework 1.0.
/// </summary>
string StackTrace { get; }
/// <summary>
/// The number of asserts executed when running the test and all its children.
/// </summary>
int AssertCount { get; }
/// <summary>
/// The number of test cases that failed when running the test and all its children.
/// </summary>
int FailCount { get; }
/// <summary>
/// The number of test cases that passed when running the test and all its children.
/// </summary>
int PassCount { get; }
/// <summary>
/// The number of test cases that were skipped when running the test and all its children.
/// </summary>
int SkipCount { get; }
/// <summary>
///The number of test cases that were inconclusive when running the test and all its children.
/// </summary>
int InconclusiveCount { get; }
/// <summary>
/// Accessing HasChildren should not force creation of the Children collection in classes implementing this interface.
/// </summary>
/// <returns>True if this result has any child results.</returns>
bool HasChildren { get; }
/// <summary>
/// Gets the the collection of child results.
/// </summary>
IEnumerable<ITestResultAdaptor> Children { get; }
/// <summary>
/// Gets any text output written to this result.
/// </summary>
string Output { get; }
/// <summary>
/// Use this to save the results to an XML file
/// </summary>
/// <returns>
/// The test results as an `NUnit` XML node.
/// </returns>
TNode ToXml();
}
}