public void Should_not_register_entity_types_in_application_container_when_initializing_bootstrapper() { // Given var rootPathProvider = Mock.Of<IRootPathProvider>(); var bootstrapper = new CommuterBootstrapper(rootPathProvider); // When bootstrapper.Initialise(); // Then var applicationContainer = bootstrapper.GetApplicationContainer(); Assert.Throws<TinyIoCResolutionException>(() => applicationContainer.Resolve<ITrainRoute>()); }
public void Should_use_custom_root_path_provider_when_when_initializing_bootstrapper() { var expectedHaveBeenCalled = false; // Given var rootPathProvider = new Mock<CommuterRootPathProvider>(); rootPathProvider.Setup(r => r.GetRootPath()).Callback(() => { expectedHaveBeenCalled = true; }); var bootstrapper = new CommuterBootstrapper(rootPathProvider.Object); // When bootstrapper.Initialise(); // Then Assert.True(expectedHaveBeenCalled); }