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"));
            });
        }
Beispiel #2
0
        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"));
            });
        }