2010-03-17 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mcs / nunit24 / NUnitCore / interfaces / EventListener.cs
1 // ****************************************************************\r
2 // This is free software licensed under the NUnit license. You\r
3 // may obtain a copy of the license as well as information regarding\r
4 // copyright ownership at http://nunit.org/?p=license&r=2.4.\r
5 // ****************************************************************\r
6 \r
7 namespace NUnit.Core\r
8 {\r
9         using System;\r
10 \r
11         /// <summary>\r
12         /// The EventListener interface is used within the NUnit core to receive \r
13         /// notifications of significant events while a test is being run. These\r
14         /// events are propogated to any client, which may choose to convert them\r
15         /// to .NET events or to use them directly.\r
16         /// </summary>\r
17         public interface EventListener\r
18         {\r
19                 /// <summary>\r
20                 /// Called when a test run is starting\r
21                 /// </summary>\r
22                 /// <param name="name">The name of the test being started</param>\r
23                 /// <param name="testCount">The number of test cases under this test</param>\r
24                 void RunStarted( string name, int testCount );\r
25 \r
26                 /// <summary>\r
27                 /// Called when a run finishes normally\r
28                 /// </summary>\r
29                 /// <param name="result">The result of the test</param>\r
30                 void RunFinished( TestResult result );\r
31 \r
32                 /// <summary>\r
33                 /// Called when a run is terminated due to an exception\r
34                 /// </summary>\r
35                 /// <param name="exception">Exception that was thrown</param>\r
36                 void RunFinished( Exception exception );\r
37 \r
38                 /// <summary>\r
39                 /// Called when a test case is starting\r
40                 /// </summary>\r
41                 /// <param name="testName">The name of the test case</param>\r
42                 void TestStarted(TestName testName);\r
43                         \r
44                 /// <summary>\r
45                 /// Called when a test case has finished\r
46                 /// </summary>\r
47                 /// <param name="result">The result of the test</param>\r
48                 void TestFinished(TestCaseResult result);\r
49 \r
50                 /// <summary>\r
51                 /// Called when a suite is starting\r
52                 /// </summary>\r
53                 /// <param name="testName">The name of the suite</param>\r
54                 void SuiteStarted(TestName testName);\r
55 \r
56                 /// <summary>\r
57                 /// Called when a suite has finished\r
58                 /// </summary>\r
59                 /// <param name="result">The result of the suite</param>\r
60                 void SuiteFinished(TestSuiteResult result);\r
61 \r
62                 /// <summary>\r
63                 /// Called when an unhandled exception is detected during\r
64                 /// the execution of a test run.\r
65                 /// </summary>\r
66                 /// <param name="exception">The exception thta was detected</param>\r
67                 void UnhandledException( Exception exception );\r
68 \r
69                 /// <summary>\r
70                 /// Called when the test direts output to the console.\r
71                 /// </summary>\r
72                 /// <param name="testOutput">A console message</param>\r
73                 void TestOutput(TestOutput testOutput);\r
74         }\r
75 }\r