TestResultAdaptor.cs
1.46 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
using System;
using UnityEditor.TestTools.TestRunner.Api;
namespace Microsoft.Unity.VisualStudio.Editor.Testing
{
[Serializable]
internal class TestResultAdaptorContainer
{
public TestResultAdaptor[] TestResultAdaptors;
}
[Serializable]
internal class TestResultAdaptor
{
public string Name;
public string FullName;
public int PassCount;
public int FailCount;
public int InconclusiveCount;
public int SkipCount;
public string ResultState;
public string StackTrace;
public TestStatusAdaptor TestStatus;
public int Parent;
public TestResultAdaptor(ITestResultAdaptor testResultAdaptor, int parent)
{
Name = testResultAdaptor.Name;
FullName = testResultAdaptor.FullName;
PassCount = testResultAdaptor.PassCount;
FailCount = testResultAdaptor.FailCount;
InconclusiveCount = testResultAdaptor.InconclusiveCount;
SkipCount = testResultAdaptor.SkipCount;
switch (testResultAdaptor.TestStatus)
{
case UnityEditor.TestTools.TestRunner.Api.TestStatus.Passed:
TestStatus = TestStatusAdaptor.Passed;
break;
case UnityEditor.TestTools.TestRunner.Api.TestStatus.Skipped:
TestStatus = TestStatusAdaptor.Skipped;
break;
case UnityEditor.TestTools.TestRunner.Api.TestStatus.Inconclusive:
TestStatus = TestStatusAdaptor.Inconclusive;
break;
case UnityEditor.TestTools.TestRunner.Api.TestStatus.Failed:
TestStatus = TestStatusAdaptor.Failed;
break;
}
Parent = parent;
}
}
}