~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to addins/RowTest/NUnitExtension.RowTest.AddIn.UnitTests/BaseTestFixture.cs

  • Committer: charliepoole
  • Date: 2008-05-05 22:17:22 UTC
  • Revision ID: vcs-imports@canonical.com-20080505221722-7bdjujqed8pk6al3
Add back RowTestExtension as a separately compiled assembly, bundled
with NUnit, and modify build script to handle addins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// *********************************************************************
 
2
// Copyright 2007, Andreas Schlapsi
 
3
// This is free software licensed under the MIT license. 
 
4
// *********************************************************************
 
5
using System;
 
6
using System.Reflection;
 
7
 
 
8
namespace NUnitExtension.RowTest.AddIn.UnitTests
 
9
{
 
10
        public class BaseTestFixture
 
11
        {
 
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";
 
18
                
 
19
                public BaseTestFixture()
 
20
                {
 
21
                }
 
22
                
 
23
                protected MethodInfo GetRowTestMethodWith2Rows()
 
24
                {
 
25
                        return GetTestClassMethod(Method_RowTestMethodWith2Rows);
 
26
                }
 
27
                
 
28
                protected MethodInfo GetRowTestMethodWithTestName()
 
29
                {
 
30
                        return GetTestClassMethod(Method_RowTestMethodWithTestName);
 
31
                }
 
32
                
 
33
                protected MethodInfo GetRowTestMethodWithExpectedException()
 
34
                {
 
35
                        return GetTestClassMethod(Method_RowTestMethodWithExpectedException);
 
36
                }
 
37
                
 
38
                protected MethodInfo GetRowTestMethodWithExpectedExceptionAndExceptionMessage()
 
39
                {
 
40
                        return GetTestClassMethod(Method_RowTestMethodWithExpectedExceptionAndExceptionMessage);
 
41
                }
 
42
                
 
43
                protected MethodInfo GetRowTestMethodWithNullArgument()
 
44
                {
 
45
                        return GetTestClassMethod(Method_RowTestMethodWithNullArgument);
 
46
                }
 
47
                
 
48
                protected MethodInfo GetRowTestMethodWithNormalAndNullArgument()
 
49
                {
 
50
                        return GetTestClassMethod(Method_RowTestMethodWithNormalAndNullArgument);
 
51
                }
 
52
                
 
53
                protected MethodInfo GetTestClassMethod(string methodName)
 
54
                {
 
55
                        Type testClass = typeof(TestClass);
 
56
                        return testClass.GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance);
 
57
                }
 
58
        }
 
59
}