1 // ****************************************************************
2 // This is free software licensed under the NUnit license. You
3 // may obtain a copy of the license as well as information regarding
4 // copyright ownership at http://nunit.org/?p=license&r=2.4.
5 // ****************************************************************
12 /// The EventListener interface is used within the NUnit core to receive
13 /// notifications of significant events while a test is being run. These
14 /// events are propogated to any client, which may choose to convert them
15 /// to .NET events or to use them directly.
17 public interface EventListener
20 /// Called when a test run is starting
22 /// <param name="name">The name of the test being started</param>
23 /// <param name="testCount">The number of test cases under this test</param>
24 void RunStarted( string name
, int testCount
);
27 /// Called when a run finishes normally
29 /// <param name="result">The result of the test</param>
30 void RunFinished( TestResult result
);
33 /// Called when a run is terminated due to an exception
35 /// <param name="exception">Exception that was thrown</param>
36 void RunFinished( Exception exception
);
39 /// Called when a test case is starting
41 /// <param name="testName">The name of the test case</param>
42 void TestStarted(TestName testName
);
45 /// Called when a test case has finished
47 /// <param name="result">The result of the test</param>
48 void TestFinished(TestCaseResult result
);
51 /// Called when a suite is starting
53 /// <param name="testName">The name of the suite</param>
54 void SuiteStarted(TestName testName
);
57 /// Called when a suite has finished
59 /// <param name="result">The result of the suite</param>
60 void SuiteFinished(TestSuiteResult result
);
63 /// Called when an unhandled exception is detected during
64 /// the execution of a test run.
66 /// <param name="exception">The exception thta was detected</param>
67 void UnhandledException( Exception exception
);
70 /// Called when the test direts output to the console.
72 /// <param name="testOutput">A console message</param>
73 void TestOutput(TestOutput testOutput
);