Пример #1
0
 public void FixtureWithNoTestsShouldNotCallFixtureSetUpOrTearDown()
 {
     FixtureWithNoTests fixture = new FixtureWithNoTests();
     RunTestOnFixture( fixture );
     Assert.IsFalse( fixture.setupCalled, "TestFixtureSetUp called running fixture" );
     Assert.IsFalse( fixture.teardownCalled, "TestFixtureTearDown called running fixture" );
 }
Пример #2
0
        public void FixtureWithNoTestsCallsFixtureSetUpAndTearDown()
        {
            // NOTE: Beginning with NUnit 2.5.3, FixtureSetUp and TearDown
            // are called even if the fixture contains no tests.

            FixtureWithNoTests fixture = new FixtureWithNoTests();
            RunTestOnFixture( fixture );
            Assert.IsTrue( fixture.setupCalled, "TestFixtureSetUp not called" );
            Assert.IsTrue( fixture.teardownCalled, "TestFixtureTearDown not called" );
        }