1
// *********************************************************************
2
// Copyright 2007, Andreas Schlapsi
3
// This is free software licensed under the MIT license.
4
// *********************************************************************
6
using System.Reflection;
8
namespace NUnitExtension.RowTest.AddIn.UnitTests
10
public class BaseTestFixture
12
protected const string Method_RowTestMethodWith2Rows = "RowTestMethodWith2Rows";
13
protected const string Method_RowTestMethodWithTestName = "RowTestMethodWithTestName";
14
protected const string Method_RowTestMethodWithExpectedException = "RowTestMethodWithExpectedException";
15
protected const string Method_RowTestMethodWithExpectedExceptionAndExceptionMessage = "RowTestMethodWithExpectedExceptionAndExceptionMessage";
16
protected const string Method_RowTestMethodWithNullArgument = "RowTestMethodWithNullArgument";
17
protected const string Method_RowTestMethodWithNormalAndNullArgument = "RowTestMethodWithNormalAndNullArgument";
19
public BaseTestFixture()
23
protected MethodInfo GetRowTestMethodWith2Rows()
25
return GetTestClassMethod(Method_RowTestMethodWith2Rows);
28
protected MethodInfo GetRowTestMethodWithTestName()
30
return GetTestClassMethod(Method_RowTestMethodWithTestName);
33
protected MethodInfo GetRowTestMethodWithExpectedException()
35
return GetTestClassMethod(Method_RowTestMethodWithExpectedException);
38
protected MethodInfo GetRowTestMethodWithExpectedExceptionAndExceptionMessage()
40
return GetTestClassMethod(Method_RowTestMethodWithExpectedExceptionAndExceptionMessage);
43
protected MethodInfo GetRowTestMethodWithNullArgument()
45
return GetTestClassMethod(Method_RowTestMethodWithNullArgument);
48
protected MethodInfo GetRowTestMethodWithNormalAndNullArgument()
50
return GetTestClassMethod(Method_RowTestMethodWithNormalAndNullArgument);
53
protected MethodInfo GetTestClassMethod(string methodName)
55
Type testClass = typeof(TestClass);
56
return testClass.GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance);