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

/src/NUnit/core/NUnitTestMethod.cs

#
C# | 39 lines | 21 code | 5 blank | 13 comment | 0 complexity | bad58a28612781a0c3bdb461d31a3c74 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. /// Class to implement an NUnit test method
  12. /// </summary>
  13. public class NUnitTestMethod : TestMethod
  14. {
  15. #region Constructor
  16. public NUnitTestMethod(MethodInfo method) : base(method)
  17. {
  18. }
  19. #endregion
  20. #region TestMethod Overrides
  21. /// <summary>
  22. /// Run a test returning the result. Overrides TestMethod
  23. /// to count assertions.
  24. /// </summary>
  25. /// <param name="testResult"></param>
  26. public override TestResult RunTest()
  27. {
  28. TestResult testResult = base.RunTest();
  29. testResult.AssertCount = NUnitFramework.Assert.GetAssertCount();
  30. return testResult;
  31. }
  32. #endregion
  33. }
  34. }