PageRenderTime 40ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/interfaces/ITest.cs

#
C# | 91 lines | 23 code | 14 blank | 54 comment | 0 complexity | 232553aa702fdf0667da6f980e4e2799 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. using System.Collections;
  7. namespace NUnit.Core
  8. {
  9. /// <summary>
  10. /// Common interface supported by all representations
  11. /// of a test. Only includes informational fields.
  12. /// The Run method is specifically excluded to allow
  13. /// for data-only representations of a test.
  14. /// </summary>
  15. public interface ITest
  16. {
  17. #region Properties
  18. /// <summary>
  19. /// Gets the completely specified name of the test
  20. /// encapsulated in a TestName object.
  21. /// </summary>
  22. TestName TestName { get; }
  23. /// <summary>
  24. /// Gets a string representing the type of test, e.g.: "Test Case"
  25. /// </summary>
  26. string TestType { get; }
  27. /// <summary>
  28. /// Indicates whether the test can be run using
  29. /// the RunState enum.
  30. /// </summary>
  31. RunState RunState { get; set; }
  32. /// <summary>
  33. /// Reason for not running the test, if applicable
  34. /// </summary>
  35. string IgnoreReason { get; set; }
  36. /// <summary>
  37. /// Count of the test cases ( 1 if this is a test case )
  38. /// </summary>
  39. int TestCount { get; }
  40. /// <summary>
  41. /// Categories available for this test
  42. /// </summary>
  43. IList Categories { get; }
  44. /// <summary>
  45. /// Return the description field.
  46. /// </summary>
  47. string Description { get; set; }
  48. /// <summary>
  49. /// Return additional properties of the test
  50. /// </summary>
  51. IDictionary Properties { get; }
  52. /// <summary>
  53. /// True if this is a suite
  54. /// </summary>
  55. bool IsSuite { get; }
  56. /// <summary>
  57. /// Gets the parent test of this test
  58. /// </summary>
  59. ITest Parent { get; }
  60. /// <summary>
  61. /// For a test suite, the child tests or suites
  62. /// Null if this is not a test suite
  63. /// </summary>
  64. IList Tests { get; }
  65. #endregion
  66. #region Methods
  67. /// <summary>
  68. /// Count the test cases that pass a filter. The
  69. /// result should match those that would execute
  70. /// when passing the same filter to Run.
  71. /// </summary>
  72. /// <param name="filter">The filter to apply</param>
  73. /// <returns>The count of test cases</returns>
  74. int CountTestCases(ITestFilter filter);
  75. #endregion
  76. }
  77. }