public void Initialise_ShouldReturnBootstrapper() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var bootstrapper = StructuremapThuriaBootstrapper.Create().Build(); //---------------Test Result ----------------------- bootstrapper.Should().NotBeNull(); bootstrapper.Should().BeAssignableTo <IThuriaBootstrapper>(); bootstrapper.Should().BeAssignableTo <IStructuremapThuriaBootstrapper>(); bootstrapper.Should().BeAssignableTo <StructuremapThuriaBootstrapper>(); }
public void WithObjectMapping_GivenMappings_ShouldAddMappingsToContainer() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var bootstrapper = StructuremapThuriaBootstrapper.Create() .WithObjectMapping(typeof(IFakeInterface), typeof(FakeClass)) .Build(); //---------------Test Result ----------------------- var fakeClass = bootstrapper.IocContainer.GetInstance <IFakeInterface>(); fakeClass.Should().NotBeNull(); fakeClass.Should().BeAssignableTo <IFakeInterface>(); }
public void WithRegistry_GivenRegistry_ShouldAddRegistryToRegistryCollection() { //---------------Set up test pack------------------- var fakeRegistry = new FakeRegistry(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var bootstrapper = StructuremapThuriaBootstrapper.Create() .WithRegistry(fakeRegistry) .Build(); //---------------Test Result ----------------------- var fakeClass = bootstrapper.IocContainer.GetInstance <IFakeInterface>(); Assert.IsNotNull(fakeClass); Assert.IsInstanceOf <FakeClass>(fakeClass); }