public override void SetUp() { base.SetUp(); AddCodeFile("test.cs", @"using NUnit.Framework; namespace RootNamespace.Tests { [TestFixture] class MyTestFixture { [Test] public void TestMethod1() {} [Test] public void TestMethod2() {} } }"); testClass = testProject.GetTestClass(new FullTypeName("RootNamespace.Tests.MyTestFixture")); testMethod1 = testClass.FindTestMethod("TestMethod1"); testMethod2 = testClass.FindTestMethod("TestMethod2"); }
public override void SetUp() { base.SetUp(); AddCodeFileInNamespace("base.cs", @" abstract class MyTestFixtureBase { [Test] public void MyTest() {} [Test] public void MyTest() {} }"); AddCodeFileInNamespace("derived.cs", @" class MyTestFixture : MyTestFixtureBase { [Test] public void MyTest() {} [Test] public void MyTest() {} }"); testClass = testProject.NestedTests.Cast <NUnitTestClass>().Single(c => c.ClassName == "MyTestFixture"); baseMethod = testClass.FindTestMethod("MyTestFixtureBase.MyTest"); derivedMethod = testClass.FindTestMethod("MyTest"); }
public void DerivedMethod() { Assert.IsNotNull(testClass.FindTestMethod("DerivedMethod")); }