public void TearDownCallsClassWithInterface() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteTearDown(obj); Assert.IsFalse(obj.OnBuiltUp__Called); Assert.IsTrue(obj.OnTearingDown__Called); }
public void TearDownIgnoresClassWithoutInterface() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Ignorant(); context.Strategies.Add(strategy); context.ExecuteTearDown(obj); Assert.IsFalse(obj.OnBuiltUpWasCalled); Assert.IsFalse(obj.OnTearingDownWasCalled); }