PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/interfaces/EventListener.cs

#
C# | 75 lines | 16 code | 10 blank | 49 comment | 0 complexity | 8e08233f4ec1790cddb346bcae582aad MD5 | raw file
Possible License(s): GPL-2.0
  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. namespace NUnit.Core
  7. {
  8. using System;
  9. /// <summary>
  10. /// The EventListener interface is used within the NUnit core to receive
  11. /// notifications of significant events while a test is being run. These
  12. /// events are propogated to any client, which may choose to convert them
  13. /// to .NET events or to use them directly.
  14. /// </summary>
  15. public interface EventListener
  16. {
  17. /// <summary>
  18. /// Called when a test run is starting
  19. /// </summary>
  20. /// <param name="name">The name of the test being started</param>
  21. /// <param name="testCount">The number of test cases under this test</param>
  22. void RunStarted( string name, int testCount );
  23. /// <summary>
  24. /// Called when a run finishes normally
  25. /// </summary>
  26. /// <param name="result">The result of the test</param>
  27. void RunFinished( TestResult result );
  28. /// <summary>
  29. /// Called when a run is terminated due to an exception
  30. /// </summary>
  31. /// <param name="exception">Exception that was thrown</param>
  32. void RunFinished( Exception exception );
  33. /// <summary>
  34. /// Called when a test case is starting
  35. /// </summary>
  36. /// <param name="testName">The name of the test case</param>
  37. void TestStarted(TestName testName);
  38. /// <summary>
  39. /// Called when a test case has finished
  40. /// </summary>
  41. /// <param name="result">The result of the test</param>
  42. void TestFinished(TestResult result);
  43. /// <summary>
  44. /// Called when a suite is starting
  45. /// </summary>
  46. /// <param name="testName">The name of the suite</param>
  47. void SuiteStarted(TestName testName);
  48. /// <summary>
  49. /// Called when a suite has finished
  50. /// </summary>
  51. /// <param name="result">The result of the suite</param>
  52. void SuiteFinished(TestResult result);
  53. /// <summary>
  54. /// Called when an unhandled exception is detected during
  55. /// the execution of a test run.
  56. /// </summary>
  57. /// <param name="exception">The exception thta was detected</param>
  58. void UnhandledException( Exception exception );
  59. /// <summary>
  60. /// Called when the test direts output to the console.
  61. /// </summary>
  62. /// <param name="testOutput">A console message</param>
  63. void TestOutput(TestOutput testOutput);
  64. }
  65. }