Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/nunit/src/NUnitCore/ITestListener.cs')
-rw-r--r--mcs/nunit/src/NUnitCore/ITestListener.cs135
1 files changed, 61 insertions, 74 deletions
diff --git a/mcs/nunit/src/NUnitCore/ITestListener.cs b/mcs/nunit/src/NUnitCore/ITestListener.cs
index 175814b5d32..87726ea95d4 100644
--- a/mcs/nunit/src/NUnitCore/ITestListener.cs
+++ b/mcs/nunit/src/NUnitCore/ITestListener.cs
@@ -1,78 +1,65 @@
-namespace NUnit.Framework {
-
- using System;
+namespace NUnit.Framework
+{
+ using System;
- /// <summary>A Listener for test progress</summary>
- public interface ITestListener {
- /// <summary>An error occurred.</summary>
- void AddError(ITest test, Exception t);
-
- /// <summary>A failure occurred.</summary>
- void AddFailure(ITest test, AssertionFailedError t);
+ /// <summary>A Listener for test progress</summary>
+ public interface ITestListener
+ {
+ /// <summary>An error occurred.</summary>
+ void AddError(ITest test, Exception ex);
- /// <summary>A test ended.</summary>
- void EndTest(ITest test);
+ /// <summary>A failure occurred.</summary>
+ void AddFailure(ITest test, AssertionFailedError ex);
- /// <summary>A test started.</summary>
- void StartTest(ITest test);
- }
- /// <summary>
- ///
- /// </summary>
- public delegate void TestEventHandler(Object source, TestEventArgs e);
- /// <summary>
- ///
- /// </summary>
- public class TestEventArgs : EventArgs{
- /// <summary>
- ///
- /// </summary>
- protected ITest fTest;
- /// <summary>
- ///
- /// </summary>
- protected TestEventArgs (){}
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public TestEventArgs (ITest test){
- fTest = test;
- }
- /// <summary>
- ///
- /// </summary>
- public ITest Test{
- get{return fTest;}
- }
- }
- /// <summary>
- ///
- /// </summary>
- public delegate void TestExceptionEventHandler(Object source,
- TestExceptionEventArgs e);
- /// <summary>
- ///
- /// </summary>
- public class TestExceptionEventArgs : TestEventArgs{
- private TestExceptionEventArgs(){}
+ /// <summary>A test ended.</summary>
+ void EndTest(ITest test);
- private Exception fThrownException;
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="e"></param>
- public TestExceptionEventArgs(ITest test, Exception e){
- //this(test);
- fTest = test;
- fThrownException = e;
- }
- /// <summary>
- ///
- /// </summary>
- public Exception ThrownException{
- get{return fThrownException;}
- }
- }
-}
+ /// <summary>A test started.</summary>
+ void StartTest(ITest test);
+ }
+#if false
+ public class TestEventArgs : System.EventArgs
+ {
+ private readonly ITest fTest;
+ public TestEventArgs(ITest test) : base()
+ {
+ fTest = test;
+ }
+ public ITest Test
+ {
+ get { return fTest;}
+ }
+ }
+ public class TestErrorArgs : TestEventArgs
+ {
+ private readonly Exception fThrownException;
+
+ public TestErrorArgs(ITest test, Exception thrownException) : base(test)
+ {
+ fThrownException = thrownException;
+ }
+
+ public TestErrorArgs(TestFailure error)
+ : this(error.FailedTest,error.ThrownException){}
+
+ public Exception ThrownException
+ {
+ get { return fThrownException;}
+
+ }
+ }
+
+ public delegate void TestErrorHandler(TestFailure failure);
+ public delegate void TestEventHandler(ITest test);
+
+ public interface ITestEvents
+ {
+ event TestErrorHandler TestErred;
+ event TestErrorHandler TestFailed;
+ event TestEventHandler TestStarted;
+ event TestEventHandler TestEnded;
+ event TestEventHandler RunStarted;
+ event TestEventHandler RunEnded;
+ }
+#endif
+} \ No newline at end of file