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

/src/NUnit/framework/Attributes/IgnoreAttribute.cs

#
C# | 47 lines | 21 code | 5 blank | 21 comment | 0 complexity | f07891e7e86ad158df4e224ae4ad9b37 MD5 | raw file
 1// ****************************************************************
 2// This is free software licensed under the NUnit license. You
 3// may obtain a copy of the license as well as information regarding
 4// copyright ownership at http://nunit.org.
 5// ****************************************************************
 6
 7namespace NUnit.Framework
 8{
 9	using System;
10
11	/// <summary>
12	/// Attribute used to mark a test that is to be ignored.
13	/// Ignored tests result in a warning message when the
14	/// tests are run.
15	/// </summary>
16	[AttributeUsage(AttributeTargets.Method|AttributeTargets.Class|AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
17	public class IgnoreAttribute : Attribute
18	{
19		private string reason;
20
21		/// <summary>
22		/// Constructs the attribute without giving a reason 
23		/// for ignoring the test.
24		/// </summary>
25		public IgnoreAttribute()
26		{
27			this.reason = "";
28		}
29
30		/// <summary>
31		/// Constructs the attribute giving a reason for ignoring the test
32		/// </summary>
33		/// <param name="reason">The reason for ignoring the test</param>
34		public IgnoreAttribute(string reason)
35		{
36			this.reason = reason;
37		}
38
39		/// <summary>
40		/// The reason for ignoring a test
41		/// </summary>
42		public string Reason
43		{
44			get { return reason; }
45		}
46	}
47}