PageRenderTime 34ms CodeModel.GetById 25ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/core/NUnitTestMethod.cs

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