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