PageRenderTime 48ms CodeModel.GetById 5ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/core/IgnoreDecorator.cs

#
C# | 39 lines | 23 code | 6 blank | 10 comment | 2 complexity | ce7b8b1c2aa246be83fb9b4fbfa0d0d9 MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // Copyright 2007, Charlie Poole
  3. // This is free software licensed under the NUnit license. You may
  4. // obtain a copy of the license at http://nunit.org.
  5. // ****************************************************************
  6. using System;
  7. using System.Reflection;
  8. namespace NUnit.Core
  9. {
  10. /// <summary>
  11. /// Ignore Decorator is an alternative method of marking tests to
  12. /// be ignored. It is currently not used, since the test builders
  13. /// take care of the ignore attribute.
  14. /// </summary>
  15. public class IgnoreDecorator : Extensibility.ITestDecorator
  16. {
  17. public IgnoreDecorator( string ignoreAttributeType )
  18. {
  19. }
  20. #region ITestDecorator Members
  21. public Test Decorate( Test test, MemberInfo member )
  22. {
  23. Attribute ignoreAttribute = Reflect.GetAttribute( member, NUnitFramework.IgnoreAttribute, false );
  24. if ( ignoreAttribute != null )
  25. {
  26. test.RunState = RunState.Ignored;
  27. test.IgnoreReason = NUnitFramework.GetIgnoreReason( ignoreAttribute );
  28. }
  29. return test;
  30. }
  31. #endregion
  32. }
  33. }