PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/interfaces/Extensibility/ITestDecorator.cs

#
C# | 54 lines | 16 code | 2 blank | 36 comment | 0 complexity | b0c112b05cdc0128e61c67cb6b97230b MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // Copyright 2007, 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;
  7. using System.Reflection;
  8. namespace NUnit.Core.Extensibility
  9. {
  10. /// <summary>
  11. /// DecoratorPriority wraps constants that may be used
  12. /// to represent the relative priority of TestDecorators.
  13. /// Decorators with a lower priority are applied first
  14. /// so that higher priority decorators wrap them.
  15. ///
  16. /// NOTE: This feature is subject to change.
  17. /// </summary>
  18. public class DecoratorPriority
  19. {
  20. /// <summary>
  21. /// The default priority, equivalent to Normal
  22. /// </summary>
  23. public static readonly int Default = 0;
  24. /// <summary>
  25. /// Priority for Decorators that must apply first
  26. /// </summary>
  27. public static readonly int First = 1;
  28. /// <summary>
  29. /// Normal Decorator priority
  30. /// </summary>
  31. public static readonly int Normal = 5;
  32. /// <summary>
  33. /// Priority for Decorators that must apply last
  34. /// </summary>
  35. public static readonly int Last = 9;
  36. }
  37. /// <summary>
  38. /// The ITestDecorator interface is exposed by a class that knows how to
  39. /// enhance the functionality of a test case or suite by decorating it.
  40. /// </summary>
  41. public interface ITestDecorator
  42. {
  43. /// <summary>
  44. /// Examine the a Test and either return it as is, modify it
  45. /// or return a different TestCase.
  46. /// </summary>
  47. /// <param name="test">The Test to be decorated</param>
  48. /// <param name="member">The MethodInfo used to construct the test</param>
  49. /// <returns>The resulting Test</returns>
  50. Test Decorate( Test test, MemberInfo member );
  51. }
  52. }