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/?p=license&r=2.4. 5 // **************************************************************** 6 7 namespace 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)] 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> IgnoreAttribute()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> IgnoreAttribute(string reason)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 } 48