PageRenderTime 50ms CodeModel.GetById 43ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/framework/Attributes/TestAttribute.cs

#
C# | 46 lines | 14 code | 3 blank | 29 comment | 0 complexity | e44425910cbb83a34d38c1da5e9ac6e3 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	/// Adding this attribute to a method within a <seealso cref="TestFixtureAttribute"/> 
13	/// class makes the method callable from the NUnit test runner. There is a property 
14	/// called Description which is optional which you can provide a more detailed test
15	/// description. This class cannot be inherited.
16	/// </summary>
17	/// 
18	/// <example>
19	/// [TestFixture]
20	/// public class Fixture
21	/// {
22	///   [Test]
23	///   public void MethodToTest()
24	///   {}
25	///   
26	///   [Test(Description = "more detailed description")]
27	///   publc void TestDescriptionMethod()
28	///   {}
29	/// }
30	/// </example>
31	/// 
32	[AttributeUsage(AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
33	public class TestAttribute : Attribute
34	{
35		private string description;
36
37		/// <summary>
38		/// Descriptive text for this test
39		/// </summary>
40		public string Description
41		{
42			get { return description; }
43			set { description = value; }
44		}
45	}
46}