public void Single_call_components_should_be_disposed_when_the_child_container_is_disposed() { IContainer builder = new StructureMapObjectBuilder(); builder.Configure(typeof(SinglecallComponent), ComponentCallModelEnum.Singlecall); using (var nestedContainer = builder.BuildChildContainer()) nestedContainer.Build(typeof(SinglecallComponent)); Assert.True(SinglecallComponent.DisposeCalled); }
public void Singleton_components_should_have_their_interfaces_registered_to_avoid_beeing_disposed() { IContainer builder = new StructureMapObjectBuilder(); builder.Configure(typeof(SingletonComponent), ComponentCallModelEnum.Singleton); using (var nestedContainer = builder.BuildChildContainer()) nestedContainer.Build(typeof(ISingletonComponent)); Assert.False(SingletonComponent.DisposeCalled); }