No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ITestAdaptor.cs 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using System.Collections.Generic;
  3. using NUnit.Framework.Interfaces;
  4. namespace UnityEditor.TestTools.TestRunner.Api
  5. {
  6. /// <summary>
  7. /// ```ITestAdaptor``` is a representation of a node in the test tree implemented as a wrapper around the [NUnit](http://www.nunit.org/) [ITest](https://github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/Interfaces/ITest.cs) interface.
  8. /// </summary>
  9. public interface ITestAdaptor
  10. {
  11. /// <summary>
  12. /// The ID of the test tree node. The ID can change if you add new tests to the suite. Use UniqueName, if you want to have a more permanent point of reference.
  13. /// </summary>
  14. string Id { get; }
  15. /// <summary>
  16. /// The name of the test. E.g.,```MyTest```.
  17. /// </summary>
  18. string Name { get; }
  19. /// <summary>
  20. /// The full name of the test. E.g., ```MyNamespace.MyTestClass.MyTest```.
  21. /// </summary>
  22. string FullName { get; }
  23. /// <summary>
  24. /// The total number of test cases in the node and all sub-nodes.
  25. /// </summary>
  26. int TestCaseCount { get; }
  27. /// <summary>
  28. /// Whether the node has any children.
  29. /// </summary>
  30. bool HasChildren { get; }
  31. /// <summary>
  32. /// True if the node is a test suite/fixture, false otherwise.
  33. /// </summary>
  34. bool IsSuite { get; }
  35. /// <summary>
  36. /// The child nodes.
  37. /// </summary>
  38. IEnumerable<ITestAdaptor> Children { get; }
  39. /// <summary>
  40. /// The parent node, if any.
  41. /// </summary>
  42. ITestAdaptor Parent { get; }
  43. /// <summary>
  44. /// The test case timeout in milliseconds. Note that this value is only available on TestFinished.
  45. /// </summary>
  46. int TestCaseTimeout { get; }
  47. /// <summary>
  48. /// The type of test class as an ```NUnit``` <see cref="ITypeInfo"/>. If the node is not a test class, then the value is null.
  49. /// </summary>
  50. ITypeInfo TypeInfo { get; }
  51. /// <summary>
  52. /// The Nunit <see cref="IMethodInfo"/> of the test method. If the node is not a test method, then the value is null.
  53. /// </summary>
  54. IMethodInfo Method { get; }
  55. /// <summary>
  56. /// The array of arguments that the test method/fixture will be invoked with.
  57. /// </summary>
  58. object[] Arguments { get; }
  59. /// <summary>
  60. /// An array of the categories applied to the test or fixture.
  61. /// </summary>
  62. string[] Categories { get; }
  63. /// <summary>
  64. /// Returns true if the node represents a test assembly, false otherwise.
  65. /// </summary>
  66. bool IsTestAssembly { get; }
  67. /// <summary>
  68. /// The run state of the test node. Either ```NotRunnable```, ```Runnable```, ```Explicit```, ```Skipped```, or ```Ignored```.
  69. /// </summary>
  70. RunState RunState { get; }
  71. /// <summary>
  72. /// The description of the test.
  73. /// </summary>
  74. string Description { get; }
  75. /// <summary>
  76. /// The skip reason. E.g., if ignoring the test.
  77. /// </summary>
  78. string SkipReason { get; }
  79. /// <summary>
  80. /// The ID of the parent node.
  81. /// </summary>
  82. string ParentId { get; }
  83. /// <summary>
  84. /// The full name of the parent node.
  85. /// </summary>
  86. string ParentFullName { get; }
  87. /// <summary>
  88. /// A unique generated name for the test node. E.g., ```Tests.dll/MyNamespace/MyTestClass/[Tests][MyNamespace.MyTestClass.MyTest]```.
  89. /// </summary>
  90. string UniqueName { get; }
  91. /// <summary>
  92. /// A unique name of the parent node. E.g., ```Tests.dll/MyNamespace/[Tests][MyNamespace.MyTestClass][suite]```.
  93. /// </summary>
  94. string ParentUniqueName { get; }
  95. /// <summary>
  96. /// The child index of the node in its parent.
  97. /// </summary>
  98. int ChildIndex { get; }
  99. /// <summary>
  100. /// The mode of the test. Either **Edit Mode** or **Play Mode**.
  101. /// </summary>
  102. TestMode TestMode { get; }
  103. }
  104. }