-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestFixture.cs
More file actions
55 lines (42 loc) · 1.27 KB
/
Copy pathTestFixture.cs
File metadata and controls
55 lines (42 loc) · 1.27 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace tunit {
public class TestFixture {
public TestFixture(UnitTest unitTest, string name) {
this.unitTest = unitTest;
this.Name = name;
this.Reset();
}
public TimeSpan Duration { get; set; }
public int TestCount {
get { return this.tests.Count; }
}
public string Name { get; private set; }
public Test this[string testName] {
get { return this.tests[testName]; }
}
public string[] TestNames {
get { return this.tests.Keys.ToArray(); }
}
public UnitTest UnitTest {
get { return this.unitTest; }
}
public Test[] Tests {
get { return this.tests.Values.ToArray(); }
}
public TestStatus Status { get; set; }
public void AddTest(string testName) { this.tests.Add(testName, new Test(this, testName)); }
public void Reset() {
this.Duration = TimeSpan.Zero;
this.Status = TestStatus.NotStarted;
foreach (var test in this.tests)
test.Value.Reset();
}
public override string ToString() { return this.Name; }
private Dictionary<string, Test> tests = new Dictionary<string, Test>();
private UnitTest unitTest;
}
}