~simone.busoli/nunitv2/1071164

« back to all changes in this revision

Viewing changes to src/NUnitCore/tests/TestInfoTests.cs

  • Committer: Charlie Poole
  • Date: 2012-10-14 22:10:12 UTC
  • Revision ID: charlie@nunit.org-20121014221012-5ndweotc00gldj1z
Add ClassName and MethodName to ITest interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
                        testCase1 = (Test)testFixture.Tests[0];
32
32
                }
33
33
 
34
 
                private void CheckConstructionFromTest( ITest expected )
 
34
                private void CheckConstructionFromTest( ITest expected, string expectedClassName, string expectedMethodName )
35
35
                {
36
36
                        TestInfo actual = new TestInfo( expected );
37
37
                        Assert.AreEqual( expected.TestName, actual.TestName );
40
40
                        Assert.AreEqual( expected.IsSuite, actual.IsSuite, "IsSuite" );
41
41
                        Assert.AreEqual( expected.TestCount, actual.TestCount, "TestCount" );
42
42
 
43
 
                        if ( expected.Categories == null )
 
43
            Assert.AreEqual(expectedClassName, actual.ClassName);
 
44
            Assert.AreEqual(expectedMethodName, actual.MethodName);
 
45
            
 
46
            if (expected.Categories == null)
44
47
                                Assert.AreEqual( 0, actual.Categories.Count, "Categories" );
45
48
                        else
46
49
                        {
55
58
                [Test]
56
59
                public void ConstructFromFixture()
57
60
                {
58
 
                        CheckConstructionFromTest( testFixture );
 
61
                        CheckConstructionFromTest( testFixture, "NUnit.Tests.Assemblies.MockTestFixture", null );
59
62
                }
60
63
 
61
64
                [Test]
62
65
                public void ConstructFromSuite()
63
66
                {
64
 
                        CheckConstructionFromTest( testSuite );
 
67
                        CheckConstructionFromTest( testSuite, null, null );
65
68
                }
66
69
 
67
70
                [Test]
68
71
                public void ConstructFromTestCase()
69
72
                {
70
 
                        CheckConstructionFromTest( testCase1 );
 
73
                        CheckConstructionFromTest( testCase1, "NUnit.Tests.Assemblies.MockTestFixture", "MockTest1" );
71
74
                }
72
75
        }
73
76
}