public void TearDownIgnoresClassWithoutInterface() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Ignorant obj = new Ignorant(); context.Strategies.Add(strategy); context.HeadOfChain.TearDown(context, obj); Assert.False(obj.OnBuiltUp__Called); Assert.False(obj.OnTearingDown__Called); }
public void BuildChecksConcreteTypeAndNotRequestedType() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.HeadOfChain.BuildUp(context, typeof(Ignorant), obj); Assert.True(obj.OnBuiltUp__Called); Assert.False(obj.OnTearingDown__Called); }
public void BuildCallsClassWithInterface() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.HeadOfChain.BuildUp(context, typeof(Aware), obj); Assert.True(obj.OnBuiltUp__Called); Assert.False(obj.OnTearingDown__Called); Assert.Equal <object>(typeof(Aware), obj.OnBuiltUp_BuildKey); }