public void MakeSureSetUpAndTearDownAreCalled() { SetUpAndTearDownFixture fixture = new SetUpAndTearDownFixture(); RunTestOnFixture( fixture ); Assert.AreEqual(1, fixture.setUpCount, "SetUp"); Assert.AreEqual(1, fixture.tearDownCount, "TearDown"); }
public void RunningSingleMethodCallsSetUpAndTearDown() { SetUpAndTearDownFixture fixture = new SetUpAndTearDownFixture(); TestSuite suite = TestBuilder.MakeFixture( fixture.GetType() ); suite.Fixture = fixture; Test test = (Test)suite.Tests[0]; suite.Run(NullListener.NULL, new Filters.NameFilter( test.TestName ) ); Assert.AreEqual(1, fixture.setUpCount); Assert.AreEqual(1, fixture.tearDownCount); }