PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/interfaces/EventListener.cs

#
C# | 75 lines | 16 code | 10 blank | 49 comment | 0 complexity | 8e08233f4ec1790cddb346bcae582aad MD5 | raw file
 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.
 5// ****************************************************************
 6
 7namespace NUnit.Core
 8{
 9	using System;
10
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
18	{
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 );
25
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 );
31
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 );
37
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);
43			
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(TestResult result);
49
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);
55
56		/// <summary>
57		/// Called when a suite has finished
58		/// </summary>
59		/// <param name="result">The result of the suite</param>
60		void SuiteFinished(TestResult result);
61
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 );
68
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);
74	}
75}