public void RunShouldCallConfigureModuleCatalog() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.ConfigureModuleCatalogCalled.ShouldBeTrue(); }
public void RunShouldCallCreateShell() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.CreateShellCalled.ShouldBeTrue(); }
public void RunShouldCallConfigureRegionAdapterMappings() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.ConfigureRegionAdapterMappingsCalled.ShouldBeTrue(); }
public void RunShouldAssignRegionManagerToReturnedShell() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); RegionManager.GetRegionManager(bootstrapper.BaseShell).ShouldNotBeNull(); }
public void RunShouldCallInitializeModules() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.InitializeModulesCalled.ShouldBeTrue(); }
public void RunShouldCallConfigureDefaultRegionBehaviors() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.ConfigureDefaultRegionBehaviorsCalled.ShouldBeTrue(); }
public void RunShouldCallConfigureViewModelLocator() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.ConfigureViewModelLocatorCalled.ShouldBeTrue(); }
public void RunConfiguresServiceLocatorProvider() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); ServiceLocator.Current.ShouldBeOfType <MunqServiceLocatorAdapter>(); }
public void RunShouldCallConfigureContainer() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.ConfigureContainerCalled.ShouldBeTrue(); }
public void RunShouldNotFailIfReturnedNullShell() { var bootstrapper = new DefaultMunqBootstrapper { ShellObject = null }; Should.NotThrow(() => bootstrapper.Run()); }
public void ConfigureContainerAddsLoggerFacadeToContainer() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); var returnedCatalog = bootstrapper.BaseContainer.Resolve <ILoggerFacade>(); returnedCatalog.ShouldNotBeNull(); }
public void RunShouldLogAboutRunCompleting() { const string expectedMessageText = "Bootstrapper sequence completed."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutConfiguringRegionBehaviors() { const string expectedMessageText = "Configuring default region behaviors."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutCreatingTheContainer() { const string expectedMessageText = "Creating Munq container."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutConfiguringViewModelLocator() { const string expectedMessageText = "Configuring the ViewModelLocator to use Munq."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutConfiguringModuleCatalog() { const string expectedMessageText = "Configuring module catalog."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutInitializingTheShellIfShellCreated() { const string expectedMessageText = "Initializing the shell."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutInitializingModules() { const string expectedMessageText = "Initializing modules."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogAboutRegisteringFrameworkExceptionTypes() { const string expectedMessageText = "Registering Framework Exception Types."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void RunShouldLogLoggerCreationSuccess() { const string expectedMessageText = "Logger was created successfully."; var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldContain(expectedMessageText); }
public void ConfigureContainerAddsModuleCatalogToContainer() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); var returnedCatalog = bootstrapper.BaseContainer.Resolve <IModuleCatalog>(); returnedCatalog.ShouldNotBeNull(); returnedCatalog.ShouldBeAssignableTo <ModuleCatalog>(); }
public void RunShouldNotLogAboutInitializingTheShellIfShellIsNotCreated() { const string expectedMessageText = "Initializing shell"; var bootstrapper = new DefaultMunqBootstrapper { ShellObject = null }; bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages.ShouldNotContain(expectedMessageText); }
public void ConfigureContainerAddsRegionNavigationServiceToContainer() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); var actual1 = bootstrapper.BaseContainer.Resolve <IRegionNavigationService>(); var actual2 = bootstrapper.BaseContainer.Resolve <IRegionNavigationService>(); actual1.ShouldNotBeNull(); actual2.ShouldNotBeNull(); actual1.ShouldNotBeSameAs(actual2); }
public void ConfigureContainerAddsNavigationTargetHandlerToContainer() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); var actual1 = bootstrapper.BaseContainer.Resolve <IRegionNavigationContentLoader>(); var actual2 = bootstrapper.BaseContainer.Resolve <IRegionNavigationContentLoader>(); actual1.ShouldNotBeNull(); actual2.ShouldNotBeNull(); actual1.ShouldBeSameAs(actual2); }
public void RunShouldInitializeContainer() { var bootstrapper = new DefaultMunqBootstrapper(); var container = bootstrapper.BaseContainer; container.ShouldBeNull(); bootstrapper.Run(); container = bootstrapper.BaseContainer; container.ShouldNotBeNull(); container.ShouldBeOfType <MunqContainerWrapper>(); }
public void ShouldLocateViewModelAndResolveWithContainer() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.BaseContainer.Register <IService, MockService>(); var view = new MockView(); view.DataContext.ShouldBeNull(); ViewModelLocator.SetAutoWireViewModel(view, value: true); view.DataContext.ShouldNotBeNull(); view.DataContext.ShouldBeOfType <MockViewModel>(); ((MockViewModel)view.DataContext).MockService.ShouldNotBeNull(); }
public void RunShouldCallTheMethodsInOrder() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); bootstrapper.MethodCalls.ShouldBe( new[] { "CreateLogger", "CreateModuleCatalog", "ConfigureModuleCatalog", "CreateContainer", "ConfigureContainer", "ConfigureServiceLocator", "ConfigureViewModelLocator", "ConfigureRegionAdapterMappings", "ConfigureDefaultRegionBehaviors", "RegisterFrameworkExceptionTypes", "CreateShell", "InitializeShell", "InitializeModules" }); }
public void RunShouldLogBootstrapperSteps() { var bootstrapper = new DefaultMunqBootstrapper(); bootstrapper.Run(); IList <string> messages = bootstrapper.BaseLogger.Messages; messages[0].ShouldContain("Logger was created successfully."); messages[1].ShouldContain("Creating module catalog."); messages[2].ShouldContain("Configuring module catalog."); messages[3].ShouldContain("Creating Munq container."); messages[4].ShouldContain("Configuring the Munq container."); messages[5].ShouldContain("Configuring ServiceLocator singleton."); messages[6].ShouldContain("Configuring the ViewModelLocator to use Munq."); messages[7].ShouldContain("Configuring region adapters."); messages[8].ShouldContain("Configuring default region behaviors."); messages[9].ShouldContain("Registering Framework Exception Types."); messages[10].ShouldContain("Creating the shell."); messages[11].ShouldContain("Setting the RegionManager."); messages[12].ShouldContain("Updating Regions."); messages[13].ShouldContain("Initializing the shell."); messages[14].ShouldContain("Initializing modules."); messages[15].ShouldContain("Bootstrapper sequence completed."); }
public void CanRunBootstrapper() { var bootstrapper = new DefaultMunqBootstrapper(); Should.NotThrow(() => bootstrapper.Run()); }