-
Notifications
You must be signed in to change notification settings - Fork 307
/
Copy pathITestEngine.cs
66 lines (56 loc) · 1.74 KB
/
ITestEngine.cs
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
using System;
using System.Collections.Generic;
namespace Rubberduck.UnitTesting
{
public interface ITestEngine
{
event EventHandler<TestRunStartedEventArgs> TestRunStarted;
event EventHandler<TestStartedEventArgs> TestStarted;
event EventHandler<TestCompletedEventArgs> TestCompleted;
event EventHandler<TestRunCompletedEventArgs> TestRunCompleted;
event EventHandler TestsRefreshStarted;
event EventHandler TestsRefreshed;
IEnumerable<TestMethod> Tests { get; }
IReadOnlyList<TestMethod> LastRunTests { get; }
bool CanRun { get; }
bool CanRepeatLastRun { get; }
void Run(IEnumerable<TestMethod> tests);
void RunByOutcome(TestOutcome outcome);
void RepeatLastRun();
void RequestCancellation();
}
public class TestRunStartedEventArgs : EventArgs
{
public IReadOnlyList<TestMethod> Tests { get; }
public TestRunStartedEventArgs(IReadOnlyList<TestMethod> tests)
{
Tests = tests;
}
}
public class TestStartedEventArgs : EventArgs
{
public TestMethod Test { get; }
public TestStartedEventArgs(TestMethod test)
{
Test = test;
}
}
public class TestCompletedEventArgs : EventArgs
{
public TestMethod Test { get; }
public TestResult Result { get; }
public TestCompletedEventArgs(TestMethod test, TestResult result)
{
Test = test;
Result = result;
}
}
public class TestRunCompletedEventArgs : EventArgs
{
public long Duration { get; }
public TestRunCompletedEventArgs(long duration)
{
Duration = duration;
}
}
}