2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / nunit24 / NUnitCore / interfaces / EventListener.cs
bloba707a58cf39ce7507dc2e46774308bdb8a9215d3
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 // ****************************************************************
7 namespace NUnit.Core
9 using System;
11 /// <summary>
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.
16 /// </summary>
17 public interface EventListener
19 /// <summary>
20 /// Called when a test run is starting
21 /// </summary>
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 );
26 /// <summary>
27 /// Called when a run finishes normally
28 /// </summary>
29 /// <param name="result">The result of the test</param>
30 void RunFinished( TestResult result );
32 /// <summary>
33 /// Called when a run is terminated due to an exception
34 /// </summary>
35 /// <param name="exception">Exception that was thrown</param>
36 void RunFinished( Exception exception );
38 /// <summary>
39 /// Called when a test case is starting
40 /// </summary>
41 /// <param name="testName">The name of the test case</param>
42 void TestStarted(TestName testName);
44 /// <summary>
45 /// Called when a test case has finished
46 /// </summary>
47 /// <param name="result">The result of the test</param>
48 void TestFinished(TestCaseResult result);
50 /// <summary>
51 /// Called when a suite is starting
52 /// </summary>
53 /// <param name="testName">The name of the suite</param>
54 void SuiteStarted(TestName testName);
56 /// <summary>
57 /// Called when a suite has finished
58 /// </summary>
59 /// <param name="result">The result of the suite</param>
60 void SuiteFinished(TestSuiteResult result);
62 /// <summary>
63 /// Called when an unhandled exception is detected during
64 /// the execution of a test run.
65 /// </summary>
66 /// <param name="exception">The exception thta was detected</param>
67 void UnhandledException( Exception exception );
69 /// <summary>
70 /// Called when the test direts output to the console.
71 /// </summary>
72 /// <param name="testOutput">A console message</param>
73 void TestOutput(TestOutput testOutput);