public void Should_ignore_unregistration_of_nonexisting_component_via_generic_overload() { var sut = new ServiceComponentList <ITestComponent>(); sut.Register(new TestComponentImpl()); sut.Unregister <AnotherImpl>(); sut.Should().NotBeEmpty(); }
public void Should_ignore_unregistration_of_nonexisting_component() { var sut = new ServiceComponentList <ITestComponent>(); sut.Register(new TestComponentImpl()); sut.Unregister(new TestComponentImpl()); sut.Should().NotBeEmpty(); }
public void Should_allow_unregistration_of_existing_component_via_generic_overload() { var sut = new ServiceComponentList <ITestComponent>(); sut.Register(new TestComponentImpl()); sut.Unregister <TestComponentImpl>(); sut.Should().BeEmpty(); }
public void Should_allow_unregistration_of_existing_component() { var sut = new ServiceComponentList <ITestComponent>(); var component = new TestComponentImpl(); sut.Register(component); sut.Unregister(component); sut.Should().BeEmpty(); }
public void Should_allow_the_removal_of_default_component_via_generic_unregistration() { var sut = new ServiceComponentList <ITestComponent>(); var registeredFirst = new TestComponentImpl(); sut.Register(registeredFirst); sut.SetDefault <AnotherImpl>(); sut.Unregister <ITestComponent>(); sut.Should().BeEmpty(); }
public void Should_allow_the_unregistration_of_default_components() { var sut = new ServiceComponentList <ITestComponent>(); var registeredFirst = new TestComponentImpl(); var registeredLast = new TestComponentImpl(); var @default = new TestComponentImpl(); sut.Register(registeredFirst); sut.Register(registeredLast); sut.SetDefault(@default); sut.Unregister(@default); sut.Should().Equal(registeredLast, registeredFirst); }