~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to addins/RowTest/NUnitExtension.RowTest.AddIn/RowTestCase.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
using System.Text;
 
8
using NUnit.Core;
 
9
 
 
10
namespace NUnitExtension.RowTest.AddIn
 
11
{
 
12
        public class RowTestCase : NUnitTestMethod
 
13
        {
 
14
                private object[] _arguments;
 
15
                
 
16
                public RowTestCase(MethodInfo method, string testName, object[] arguments)
 
17
                        : base(method)
 
18
                {
 
19
                        RowTestNameBuilder testNameBuilder = new RowTestNameBuilder(method, testName, arguments);
 
20
                        this.TestName.Name = testNameBuilder.TestName;
 
21
                        this.TestName.FullName = testNameBuilder.FullTestName;
 
22
                        
 
23
                        _arguments = arguments;
 
24
                }
 
25
                
 
26
                public object[] Arguments
 
27
                {
 
28
                        get { return _arguments; }
 
29
                }
 
30
#if NUNIT_2_5
 
31
                public override void RunTestMethod(TestResult testResult)
 
32
#else
 
33
                public override void RunTestMethod(TestCaseResult testResult)
 
34
#endif
 
35
                {
 
36
                        object[] arguments = _arguments != null ? _arguments : new object[] { null };                   
 
37
                        Reflect.InvokeMethod(this.Method, this.Fixture, arguments);
 
38
            testResult.Success();   // If no exception occured
 
39
                }
 
40
        }
 
41
}