/src/NUnit/core/IgnoreDecorator.cs
C# | 39 lines | 23 code | 6 blank | 10 comment | 2 complexity | ce7b8b1c2aa246be83fb9b4fbfa0d0d9 MD5 | raw file
Possible License(s): GPL-2.0
- // ****************************************************************
- // Copyright 2007, Charlie Poole
- // This is free software licensed under the NUnit license. You may
- // obtain a copy of the license at http://nunit.org.
- // ****************************************************************
- using System;
- using System.Reflection;
-
- namespace NUnit.Core
- {
- /// <summary>
- /// Ignore Decorator is an alternative method of marking tests to
- /// be ignored. It is currently not used, since the test builders
- /// take care of the ignore attribute.
- /// </summary>
- public class IgnoreDecorator : Extensibility.ITestDecorator
- {
- public IgnoreDecorator( string ignoreAttributeType )
- {
- }
-
- #region ITestDecorator Members
-
- public Test Decorate( Test test, MemberInfo member )
- {
- Attribute ignoreAttribute = Reflect.GetAttribute( member, NUnitFramework.IgnoreAttribute, false );
-
- if ( ignoreAttribute != null )
- {
- test.RunState = RunState.Ignored;
- test.IgnoreReason = NUnitFramework.GetIgnoreReason( ignoreAttribute );
- }
-
- return test;
- }
-
- #endregion
- }
- }