A game about forced loneliness, made by TACStudios
1using System;
2using System.Collections.Generic;
3using NUnit.Framework.Interfaces;
4
5namespace UnityEditor.TestTools.TestRunner.Api
6{
7 /// <summary>
8 /// 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.
9 /// </summary>
10 public interface ITestResultAdaptor
11 {
12 /// <summary>
13 /// The test details of the test result tree node as a <see cref="TestAdaptor"/>
14 /// </summary>
15 ITestAdaptor Test { get; }
16 ///<summary>
17 ///The name of the test node.
18 ///</summary>
19 string Name { get; }
20 /// <summary>
21 /// Gets the full name of the test result
22 /// </summary>
23 ///<returns>
24 ///The name of the test result.
25 ///</returns>
26 string FullName { get; }
27 ///<summary>
28 ///Gets the state of the result as a string.
29 ///</summary>
30 ///<returns>
31 ///It returns one of these values: `Inconclusive`, `Skipped`, `Skipped:Ignored`, `Skipped:Explicit`, `Passed`, `Failed`, `Failed:Error`, `Failed:Cancelled`, `Failed:Invalid`
32 ///</returns>
33 string ResultState { get; }
34 ///<summary>
35 ///Gets the status of the test as an enum.
36 ///</summary>
37 ///<returns>
38 ///It returns one of these values:`Inconclusive`, `Skipped`, `Passed`, or `Failed`
39 ///</returns>
40 TestStatus TestStatus { get; }
41 /// <summary>
42 /// Gets the elapsed time for running the test in seconds
43 /// </summary>
44 /// <returns>
45 /// Time in seconds.
46 /// </returns>
47 double Duration { get; }
48 /// <summary>
49 /// Gets or sets the time the test started running.
50 /// </summary>
51 ///<returns>
52 ///A DataTime object.
53 ///</returns>
54 DateTime StartTime { get; }
55 ///<summary>
56 ///Gets or sets the time the test finished running.
57 ///</summary>
58 ///<returns>
59 ///A DataTime object.
60 ///</returns>
61 DateTime EndTime { get; }
62
63 /// <summary>
64 /// The message associated with a test failure or with not running the test
65 /// </summary>
66 string Message { get; }
67
68 /// <summary>
69 /// Any stacktrace associated with an error or failure. Not available in the Compact Framework 1.0.
70 /// </summary>
71 string StackTrace { get; }
72
73 /// <summary>
74 /// The number of asserts executed when running the test and all its children.
75 /// </summary>
76 int AssertCount { get; }
77
78 /// <summary>
79 /// The number of test cases that failed when running the test and all its children.
80 /// </summary>
81 int FailCount { get; }
82
83 /// <summary>
84 /// The number of test cases that passed when running the test and all its children.
85 /// </summary>
86 int PassCount { get; }
87
88 /// <summary>
89 /// The number of test cases that were skipped when running the test and all its children.
90 /// </summary>
91 int SkipCount { get; }
92
93 /// <summary>
94 ///The number of test cases that were inconclusive when running the test and all its children.
95 /// </summary>
96 int InconclusiveCount { get; }
97
98 /// <summary>
99 /// Accessing HasChildren should not force creation of the Children collection in classes implementing this interface.
100 /// </summary>
101 /// <returns>True if this result has any child results.</returns>
102 bool HasChildren { get; }
103
104 /// <summary>
105 /// Gets the the collection of child results.
106 /// </summary>
107 IEnumerable<ITestResultAdaptor> Children { get; }
108
109 /// <summary>
110 /// Gets any text output written to this result.
111 /// </summary>
112 string Output { get; }
113 /// <summary>
114 /// Use this to save the results to an XML file
115 /// </summary>
116 /// <returns>
117 /// The test results as an `NUnit` XML node.
118 /// </returns>
119 TNode ToXml();
120 }
121}