~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to addins/RowTest/NUnitExtension.RowTest.AddIn/RowTestSuite.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 NUnit.Core;
 
8
 
 
9
namespace NUnitExtension.RowTest.AddIn
 
10
{
 
11
        public class RowTestSuite : TestSuite
 
12
        {
 
13
                private static string GetParentName(MethodInfo method)
 
14
                {
 
15
                        if (method == null)
 
16
                                throw new ArgumentNullException("method");
 
17
                        
 
18
                        return method.DeclaringType.ToString();
 
19
                }
 
20
                
 
21
                private static string GetTestName(MethodInfo method)
 
22
                {
 
23
                        if (method == null)
 
24
                                throw new ArgumentNullException("method");
 
25
                        
 
26
                        return method.Name;
 
27
                }
 
28
                
 
29
                public RowTestSuite(MethodInfo method)
 
30
                        : base (GetParentName(method), GetTestName(method))
 
31
                {
 
32
                }
 
33
                
 
34
                public override TestResult Run(EventListener listener, ITestFilter filter)
 
35
                {
 
36
                        if (this.Parent != null)
 
37
                                this.Fixture = this.Parent.Fixture;
 
38
                        
 
39
                        return base.Run(listener, filter);
 
40
                }
 
41
                
 
42
                protected override void DoOneTimeSetUp(TestResult suiteResult)
 
43
                {
 
44
                }
 
45
                
 
46
                protected override void DoOneTimeTearDown(TestResult suiteResult)
 
47
                {
 
48
                }
 
49
        }
 
50
}