PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/interfaces/Extensibility/ITestCaseProvider.cs

#
C# | 60 lines | 15 code | 5 blank | 40 comment | 0 complexity | 551d24a450fb4f3897e57b51e1b9df35 MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // Copyright 2008, Charlie Poole
  3. // This is free software licensed under the NUnit license. You may
  4. // obtain a copy of the license at http://nunit.org
  5. // ****************************************************************
  6. using System.Collections;
  7. using System.Reflection;
  8. namespace NUnit.Core.Extensibility
  9. {
  10. /// <summary>
  11. /// The ITestCaseProvider interface is used by extensions
  12. /// that provide data for parameterized tests, along with
  13. /// certain flags and other indicators used in the test.
  14. /// </summary>
  15. public interface ITestCaseProvider
  16. {
  17. /// <summary>
  18. /// Determine whether any test cases are available for a parameterized method.
  19. /// </summary>
  20. /// <param name="method">A MethodInfo representing a parameterized test</param>
  21. /// <returns>True if any cases are available, otherwise false.</returns>
  22. bool HasTestCasesFor(MethodInfo method);
  23. /// <summary>
  24. /// Return an IEnumerable providing test cases for use in
  25. /// running a paramterized test.
  26. /// </summary>
  27. /// <param name="method"></param>
  28. /// <returns></returns>
  29. IEnumerable GetTestCasesFor(MethodInfo method);
  30. }
  31. /// <summary>
  32. /// ITestCaseProvider2 extends ITestCaseProvider with methods
  33. /// that include the suite for which the test case is being
  34. /// built. TestCaseProviders not needing the suite can
  35. /// continue to implement ITestCaseBuilder.
  36. /// </summary>
  37. public interface ITestCaseProvider2 : ITestCaseProvider
  38. {
  39. /// <summary>
  40. /// Determine whether any test cases are available for a parameterized method.
  41. /// </summary>
  42. /// <param name="method">A MethodInfo representing a parameterized test</param>
  43. /// <param name="suite">The suite for which the test case is being built</param>
  44. /// <returns>True if any cases are available, otherwise false.</returns>
  45. bool HasTestCasesFor(MethodInfo method, Test suite);
  46. /// <summary>
  47. /// Return an IEnumerable providing test cases for use in
  48. /// running a paramterized test.
  49. /// </summary>
  50. /// <param name="method"></param>
  51. /// <param name="suite">The suite for which the test case is being built</param>
  52. /// <returns></returns>
  53. IEnumerable GetTestCasesFor(MethodInfo method, Test suite);
  54. }
  55. }