PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/src/NUnit/core/IgnoreDecorator.cs

#
C# | 39 lines | 23 code | 6 blank | 10 comment | 2 complexity | ce7b8b1c2aa246be83fb9b4fbfa0d0d9 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
10{
11	/// <summary>
12	/// Ignore Decorator is an alternative method of marking tests to
13	/// be ignored. It is currently not used, since the test builders
14	/// take care of the ignore attribute.
15	/// </summary>
16	public class IgnoreDecorator : Extensibility.ITestDecorator
17	{
18		public IgnoreDecorator( string ignoreAttributeType )
19		{
20		}
21
22		#region ITestDecorator Members
23
24		public Test Decorate( Test test, MemberInfo member )
25		{
26			Attribute ignoreAttribute = Reflect.GetAttribute( member, NUnitFramework.IgnoreAttribute, false );
27
28			if ( ignoreAttribute != null )
29			{
30				test.RunState = RunState.Ignored;
31				test.IgnoreReason = NUnitFramework.GetIgnoreReason( ignoreAttribute );
32			}
33
34			return test;
35		}
36
37		#endregion
38	}
39}