public void Removals_dont_cause_exceptions() { Assert.DoesNotThrow(() => { var container = new DefaultContainer(); container.Register<IFoo>(r => new Foo()); Assert.IsTrue(container.Remove<IFoo>()); Assert.IsFalse(container.Remove<IFoo>()); container.Register<IFoo>("MyFoo", r=> new Foo()); Assert.IsTrue(container.Remove<IFoo>("MyFoo")); Assert.IsFalse(container.Remove<IFoo>("VitaminFail")); }); }
public void Removals_dont_cause_exceptions() { Assert.DoesNotThrow(() => { var container = new DefaultContainer(); container.Register <IFoo>(r => new Foo()); Assert.IsTrue(container.Remove <IFoo>()); Assert.IsFalse(container.Remove <IFoo>()); container.Register <IFoo>("MyFoo", r => new Foo()); Assert.IsTrue(container.Remove <IFoo>("MyFoo")); Assert.IsFalse(container.Remove <IFoo>("VitaminFail")); }); }