1 #region Copyright (c) 2002-2003, James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole, Philip A. Craig
2 /************************************************************************************
4 ' Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole
5 ' Copyright 2000-2002 Philip A. Craig
7 ' This software is provided 'as-is', without any express or implied warranty. In no
8 ' event will the authors be held liable for any damages arising from the use of this
11 ' Permission is granted to anyone to use this software for any purpose, including
12 ' commercial applications, and to alter it and redistribute it freely, subject to the
13 ' following restrictions:
15 ' 1. The origin of this software must not be misrepresented; you must not claim that
16 ' you wrote the original software. If you use this software in a product, an
17 ' acknowledgment (see the following) in the product documentation is required.
19 ' Portions Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole
20 ' or Copyright 2000-2002 Philip A. Craig
22 ' 2. Altered source versions must be plainly marked as such, and must not be
23 ' misrepresented as being the original software.
25 ' 3. This notice may not be removed or altered from any source distribution.
27 '***********************************************************************************/
31 using System.Collections;
37 /// Helper class used to dispatch test events
39 public class ProjectEventDispatcher : TestEventDispatcher, IProjectEvents
43 // Project loading events
44 public event TestProjectEventHandler ProjectLoading;
45 public event TestProjectEventHandler ProjectLoaded;
46 public event TestProjectEventHandler ProjectLoadFailed;
47 public event TestProjectEventHandler ProjectUnloading;
48 public event TestProjectEventHandler ProjectUnloaded;
49 public event TestProjectEventHandler ProjectUnloadFailed;
51 // Test loading events
52 // public event TestEventHandler TestLoading;
53 // public event TestEventHandler TestLoaded;
54 // public event TestEventHandler TestLoadFailed;
56 // public event TestEventHandler TestReloading;
57 // public event TestEventHandler TestReloaded;
58 // public event TestEventHandler TestReloadFailed;
60 // public event TestEventHandler TestUnloading;
61 // public event TestEventHandler TestUnloaded;
62 // public event TestEventHandler TestUnloadFailed;
64 // // Test running events
65 // public event TestEventHandler RunStarting;
66 // public event TestEventHandler RunFinished;
68 // public event TestEventHandler SuiteStarting;
69 // public event TestEventHandler SuiteFinished;
71 // public event TestEventHandler TestStarting;
72 // public event TestEventHandler TestFinished;
74 // public event TestEventHandler TestException;
78 #region Methods for Firing Events
81 TestEventHandler handler, TestEventArgs e )
83 if ( handler != null )
88 TestProjectEventHandler handler, TestProjectEventArgs e )
90 if ( handler != null )
94 public void FireProjectLoading( string fileName )
98 new TestProjectEventArgs( TestProjectAction.ProjectLoading, fileName ) );
101 public void FireProjectLoaded( string fileName )
105 new TestProjectEventArgs( TestProjectAction.ProjectLoaded, fileName ) );
108 public void FireProjectLoadFailed( string fileName, Exception exception )
112 new TestProjectEventArgs( TestProjectAction.ProjectLoadFailed, fileName, exception ) );
115 public void FireProjectUnloading( string fileName )
119 new TestProjectEventArgs( TestProjectAction.ProjectUnloading, fileName ) );
122 public void FireProjectUnloaded( string fileName )
126 new TestProjectEventArgs( TestProjectAction.ProjectUnloaded, fileName ) );
129 public void FireProjectUnloadFailed( string fileName, Exception exception )
133 new TestProjectEventArgs( TestProjectAction.ProjectUnloadFailed, fileName, exception ) );
136 // public void FireTestLoading( string fileName )
140 // new TestEventArgs( TestAction.TestLoading, fileName ) );
143 // public void FireTestLoaded( string fileName, ITest test )
147 // new TestEventArgs( TestAction.TestLoaded, fileName, test ) );
150 // public void FireTestLoadFailed( string fileName, Exception exception )
154 // new TestEventArgs( TestAction.TestLoadFailed, fileName, exception ) );
157 // public void FireTestUnloading( string fileName, ITest test )
161 // new TestEventArgs( TestAction.TestUnloading, fileName, test ) );
164 // public void FireTestUnloaded( string fileName, ITest test )
168 // new TestEventArgs( TestAction.TestUnloaded, fileName, test ) );
171 // public void FireTestUnloadFailed( string fileName, Exception exception )
175 // new TestEventArgs( TestAction.TestUnloadFailed, fileName, exception ) );
178 // public void FireTestReloading( string fileName, ITest test )
182 // new TestEventArgs( TestAction.TestReloading, fileName, test ) );
185 // public void FireTestReloaded( string fileName, ITest test )
189 // new TestEventArgs( TestAction.TestReloaded, fileName, test ) );
192 // public void FireTestReloadFailed( string fileName, Exception exception )
196 // new TestEventArgs( TestAction.TestReloadFailed, fileName, exception ) );
199 // public void FireRunStarting( ITest[] tests, int count )
203 // new TestEventArgs( TestAction.RunStarting, tests, count ) );
206 // public void FireRunFinished( TestResult[] results )
210 // new TestEventArgs( TestAction.RunFinished, results ) );
213 // public void FireRunFinished( Exception exception )
217 // new TestEventArgs( TestAction.RunFinished, exception ) );
220 // public void FireTestStarting( ITest test )
224 // new TestEventArgs( TestAction.TestStarting, test ) );
227 // public void FireTestFinished( TestResult result )
231 // new TestEventArgs( TestAction.TestFinished, result ) );
234 // public void FireSuiteStarting( ITest test )
238 // new TestEventArgs( TestAction.SuiteStarting, test ) );
241 // public void FireSuiteFinished( TestResult result )
245 // new TestEventArgs( TestAction.SuiteFinished, result ) );
248 // public void FireTestException( Exception exception )
252 // new TestEventArgs( TestAction.TestException, exception ) );