public void RunIgnoredTestCase() { MockTestFixture mockTestFixture = new MockTestFixture(); NUnit.Core.TestCase testCase = TestCaseBuilder.Make(mockTestFixture, "MockTest4"); Assert.AreEqual(1, testCase.CountTestCases()); TestResult result = testCase.Run(NullListener.NULL); ResultSummarizer summarizer = new ResultSummarizer(result); Assert.AreEqual(0, summarizer.ResultCount); Assert.AreEqual(1, summarizer.TestsNotRun); }
public void IgnoredFixtureShouldNotCallFixtureSetUpOrTearDown() { IgnoredFixture testFixture = new IgnoredFixture(); TestSuite suite = new TestSuite("IgnoredFixtureSuite"); suite.Add(testFixture); TestSuite fixtureSuite = (TestSuite)suite.Tests[0]; NUnit.Core.TestCase testCase = (NUnit.Core.TestCase)fixtureSuite.Tests[0]; fixtureSuite.Run(NullListener.NULL); Assert.IsFalse(testFixture.setupCalled, "TestFixtureSetUp called running fixture"); Assert.IsFalse(testFixture.teardownCalled, "TestFixtureTearDown called running fixture"); suite.Run(NullListener.NULL); Assert.IsFalse(testFixture.setupCalled, "TestFixtureSetUp called running enclosing suite"); Assert.IsFalse(testFixture.teardownCalled, "TestFixtureTearDown called running enclosing suite"); testCase.Run(NullListener.NULL); Assert.IsFalse(testFixture.setupCalled, "TestFixtureSetUp called running a test case"); Assert.IsFalse(testFixture.teardownCalled, "TestFixtureTearDown called running a test case"); }