~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to addins/RowTest/NUnitExtension.RowTest.AddIn.UnitTests/RowTestSuiteTest.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
using NUnit.Framework;
 
9
using NUnit.Framework.SyntaxHelpers;
 
10
 
 
11
namespace NUnitExtension.RowTest.AddIn.UnitTests
 
12
{
 
13
        [TestFixture]
 
14
        public class RowTestSuiteTest : BaseTestFixture
 
15
        {
 
16
                [Test]
 
17
                public void Initialize()
 
18
                {
 
19
                        MethodInfo method = GetRowTestMethodWith2Rows();
 
20
                        
 
21
                        RowTestSuite testSuite = new RowTestSuite(method);
 
22
                        
 
23
                        string pathName = method.DeclaringType.ToString();
 
24
                        Assert.That(testSuite.TestName.FullName, Is.EqualTo (pathName + "." + method.Name));
 
25
                }
 
26
                
 
27
                [Test]
 
28
                public void Run()
 
29
                {
 
30
                        TestClass fixture = new TestClass();
 
31
                        
 
32
                        TestSuite parentSuite = new TestSuite("ParentSuiteName", "Name");
 
33
                        parentSuite.Fixture = fixture;
 
34
                        
 
35
                        RowTestSuite rowTestSuite = new RowTestSuite(GetRowTestMethodWith2Rows());
 
36
                        parentSuite.Add(rowTestSuite);
 
37
                        
 
38
                        rowTestSuite.Run(new NullListener());
 
39
                        
 
40
                        Assert.That(rowTestSuite.Fixture, Is.SameAs(fixture));
 
41
                }
 
42
                
 
43
                [Test]
 
44
                public void Run_WithoutParent()
 
45
                {
 
46
                        RowTestSuite rowTestSuite = new RowTestSuite(GetRowTestMethodWith2Rows());
 
47
                        
 
48
                        rowTestSuite.Run(new NullListener());
 
49
                        
 
50
                        Assert.That(rowTestSuite.Fixture, Is.Null);
 
51
                }
 
52
                
 
53
                [Test]
 
54
                public void Run_WithTestFilter()
 
55
                {
 
56
                        TestClass fixture = new TestClass();
 
57
                        
 
58
                        TestSuite parentSuite = new TestSuite("ParentSuiteName", "Name");
 
59
                        parentSuite.Fixture = fixture;
 
60
                        
 
61
                        RowTestSuite rowTestSuite = new RowTestSuite(GetRowTestMethodWith2Rows());
 
62
                        parentSuite.Add(rowTestSuite);
 
63
                        
 
64
                        rowTestSuite.Run(new NullListener(), TestFilter.Empty);
 
65
                        
 
66
                        Assert.That(rowTestSuite.Fixture, Is.SameAs(fixture));
 
67
                }
 
68
        }
 
69
}