25
25
using System.Collections;
26
26
using System.Threading;
27
using NUnit.Framework.Api;
29
namespace NUnit.Framework.Internal
30
31
#region Individual Event Classes
33
34
/// NUnit.Core.Event is the abstract base for all stored events.
34
35
/// An Event is the stored representation of a call to the
35
/// EventListener interface and is used to record such calls
36
/// ITestListener interface and is used to record such calls
36
37
/// or to queue them for forwarding on another thread or at
41
42
abstract public void Send( ITestListener listener );
44
public class RunStartedEvent : Event
49
public RunStartedEvent( TestName testName, int testCount )
51
this.testName = testName;
52
this.testCount = testCount;
55
public override void Send( ITestListener listener )
57
listener.RunStarted(testName, testCount);
61
public class RunFinishedEvent : Event
66
public RunFinishedEvent( TestResult result )
71
public RunFinishedEvent( Exception exception )
73
this.exception = exception;
76
public override void Send( ITestListener listener )
78
if ( this.exception != null )
79
listener.RunFinished( this.exception );
81
listener.RunFinished( this.result );
85
45
public class TestStartedEvent : Event
89
public TestStartedEvent( TestName testName )
49
public TestStartedEvent( ITest test )
91
this.testName = testName;
94
54
public override void Send( ITestListener listener )
96
listener.TestStarted( this.testName );
56
listener.TestStarted( this.test );
100
60
public class TestFinishedEvent : Event
104
public TestFinishedEvent( TestResult result )
64
public TestFinishedEvent( ITestResult result )
106
66
this.result = result;
115
public class SuiteStartedEvent : Event
119
public SuiteStartedEvent( TestName suiteName )
121
this.suiteName = suiteName;
124
public override void Send( ITestListener listener )
126
listener.SuiteStarted( this.suiteName );
130
public class SuiteFinishedEvent : Event
134
public SuiteFinishedEvent( TestResult result )
136
this.result = result;
139
public override void Send( ITestListener listener )
141
listener.SuiteFinished( this.result );
145
public class UnhandledExceptionEvent : Event
149
public UnhandledExceptionEvent( Exception exception )
151
this.exception = exception;
154
public override void Send( ITestListener listener )
156
listener.UnhandledException( this.exception );
160
75
public class OutputEvent : Event
162
77
TestOutput output;