public void GivenInterfaceAndImpl_WhenRegisteringWithContainer_ThenInstanceCanBeRetrievedByType() { TypeCatalogue.Register <IFoo>(new Foo()); var instance = TypeCatalogue.Resolve <IFoo>(); Assert.NotNull(instance); Assert.IsTrue(instance is IFoo); }
public void GivenInterfaceAnDifferentImpl_WhenRegisteringTwiceWithContainer_ThenExceptionIsThrown() { Assert.Catch <ArgumentException>(() => { TypeCatalogue.Register <IFoo>(new Object()); }); }
public void TearDown() { TypeCatalogue.Clear(); }