/src/NUnit/framework/Attributes/IgnoreAttribute.cs
C# | 47 lines | 21 code | 5 blank | 21 comment | 0 complexity | f07891e7e86ad158df4e224ae4ad9b37 MD5 | raw file
Possible License(s): GPL-2.0
- // ****************************************************************
- // This is free software licensed under the NUnit license. You
- // may obtain a copy of the license as well as information regarding
- // copyright ownership at http://nunit.org.
- // ****************************************************************
-
- namespace NUnit.Framework
- {
- using System;
-
- /// <summary>
- /// Attribute used to mark a test that is to be ignored.
- /// Ignored tests result in a warning message when the
- /// tests are run.
- /// </summary>
- [AttributeUsage(AttributeTargets.Method|AttributeTargets.Class|AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
- public class IgnoreAttribute : Attribute
- {
- private string reason;
-
- /// <summary>
- /// Constructs the attribute without giving a reason
- /// for ignoring the test.
- /// </summary>
- public IgnoreAttribute()
- {
- this.reason = "";
- }
-
- /// <summary>
- /// Constructs the attribute giving a reason for ignoring the test
- /// </summary>
- /// <param name="reason">The reason for ignoring the test</param>
- public IgnoreAttribute(string reason)
- {
- this.reason = reason;
- }
-
- /// <summary>
- /// The reason for ignoring a test
- /// </summary>
- public string Reason
- {
- get { return reason; }
- }
- }
- }