PageRenderTime 45ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

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