Ejemplo n.º 1
0
        public void RunShouldLogBootstrapperSteps()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            var index = 0;

            Assert.Contains(ContainerResources.LoggerCreatedSuccessfully, messages[index++]);
            Assert.Contains(ContainerResources.CreatingModuleCatalog, messages[index++]);
            Assert.Contains(ContainerResources.ConfiguringModuleCatalog, messages[index++]);
            Assert.Contains(ContainerResources.CreatingContainer, messages[index++]);
            Assert.Contains(ContainerResources.ConfiguringContainer, messages[index++]);
            Assert.Contains(ContainerResources.ConfiguringViewModelLocator, messages[index++]);
            Assert.Contains(ContainerResources.ConfiguringRegionAdapters, messages[index++]);
            Assert.Contains(ContainerResources.ConfiguringDefaultRegionBehaviors, messages[index++]);
            Assert.Contains(ContainerResources.RegisteringFrameworkExceptionTypes, messages[index++]);
            Assert.Contains(ContainerResources.CreatingShell, messages[index++]);
            Assert.Contains(ContainerResources.SettingTheRegionManager, messages[index++]);
            Assert.Contains(ContainerResources.UpdatingRegions, messages[index++]);
            Assert.Contains(ContainerResources.InitializingShell, messages[index++]);
            Assert.Contains(ContainerResources.InitializingModules, messages[index++]);
            Assert.Contains(ContainerResources.BootstrapperSequenceCompleted, messages[index++]);
        }
Ejemplo n.º 2
0
        public void RunShouldCallConfigureDefaultRegionBehaviors()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);
        }
Ejemplo n.º 3
0
        public void RunShouldCallConfigureContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureContainerCalled);
        }
Ejemplo n.º 4
0
        public void RunShouldCallConfigureModuleCatalog()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureModuleCatalogCalled);
        }
        public void RunShouldCallRegisterTypes()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.RegisterTypesCalled);
        }
Ejemplo n.º 6
0
        public void RunShouldCallConfigureRegionAdapterMappings()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureRegionAdapterMappingsCalled);
        }
Ejemplo n.º 7
0
        public void RunShouldAssignRegionManagerToReturnedShell()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.NotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));
        }
Ejemplo n.º 8
0
        public void RunShouldCallCreateLogger()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.CreateLoggerCalled);
        }
Ejemplo n.º 9
0
        public void RunShouldCallConfigureViewModelLocator()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureViewModelLocatorCalled);
        }
Ejemplo n.º 10
0
        public void RunShouldNotFailIfReturnedNullShell()
        {
            var bootstrapper = new MockBootstrapper {
                ShellObject = null
            };

            bootstrapper.Run();
        }
Ejemplo n.º 11
0
        public void RunShouldCallInitializeModules()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.InitializeModulesCalled);
        }
Ejemplo n.º 12
0
        public void RunShouldLogAboutRegisteringFrameworkExceptionTypes()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.RegisteringFrameworkExceptionTypes));
        }
Ejemplo n.º 13
0
        public void RunShouldLogAboutConfiguringRegionBehaviors()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.ConfiguringDefaultRegionBehaviors));
        }
Ejemplo n.º 14
0
        public void RunSetsCurrentContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.NotNull(ContainerLocator.Container);
            Assert.IsType(ContainerHelper.ContainerExtensionType, ContainerLocator.Container);
        }
Ejemplo n.º 15
0
        public void RunShouldLogAboutCreatingTheContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.CreatingContainer));
        }
Ejemplo n.º 16
0
        public void RunShouldLogLoggerCreationSuccess()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.LoggerCreatedSuccessfully));
        }
Ejemplo n.º 17
0
        public void RunShouldLogAboutInitializingTheShellIfShellCreated()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.InitializingShell));
        }
Ejemplo n.º 18
0
        public void RunShouldLogAboutInitializingModules()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.InitializingModules));
        }
Ejemplo n.º 19
0
        public void RunShouldLogAboutRunCompleting()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.BootstrapperSequenceCompleted));
        }
Ejemplo n.º 20
0
        public void RunShouldLogAboutConfiguringViewModelLocator()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.True(messages.Contains(ContainerResources.ConfiguringViewModelLocator));
        }
Ejemplo n.º 21
0
        public void ConfigureContainerAddsLoggerFacadeToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            var returnedCatalog = bootstrapper.ContainerExtension.Resolve <ILoggerFacade>();

            Assert.NotNull(returnedCatalog);
        }
Ejemplo n.º 22
0
        public void SetsContainerLocatorCurrentContainer()
        {
            ContainerLocator.ResetContainer();
            Assert.Null(ContainerLocator.Container);
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.NotNull(ContainerLocator.Container);
            Assert.Same(bootstrapper.Container, ContainerLocator.Container.GetBaseContainer());
        }
Ejemplo n.º 23
0
        public void ConfigureContainerAddsModuleCatalogToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            var returnedCatalog = bootstrapper.ContainerExtension.Resolve <IModuleCatalog>();

            Assert.NotNull(returnedCatalog);
            Assert.IsType <ModuleCatalog>(returnedCatalog);
        }
Ejemplo n.º 24
0
        public void RunShouldNotLogAboutInitializingTheShellIfShellIsNotCreated()
        {
            var bootstrapper = new MockBootstrapper {
                ShellObject = null
            };

            bootstrapper.Run();
            var messages = bootstrapper.BaseLogger.Messages;

            Assert.False(messages.Contains(ContainerResources.InitializingShell));
        }
Ejemplo n.º 25
0
        public void ConfigureContainerAddsRegionNavigationServiceToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            var actual1 = bootstrapper.ContainerExtension.Resolve <IRegionNavigationService>();
            var actual2 = bootstrapper.ContainerExtension.Resolve <IRegionNavigationService>();

            Assert.NotNull(actual1);
            Assert.NotNull(actual2);
            Assert.NotSame(actual1, actual2);
        }
Ejemplo n.º 26
0
        public void ConfigureContainerAddsNavigationTargetHandlerToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            var actual1 = bootstrapper.ContainerExtension.Resolve <IRegionNavigationContentLoader>();
            var actual2 = bootstrapper.ContainerExtension.Resolve <IRegionNavigationContentLoader>();

            Assert.NotNull(actual1);
            Assert.NotNull(actual2);
            Assert.Same(actual1, actual2);
        }
Ejemplo n.º 27
0
        public void ConfiguresWhenRun()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.That(bootstrapper.ViewFactory, Is.Not.Null);

            var view = bootstrapper.ViewFactory.Resolve <MockViewModel>();

            Assert.That(view, Is.Not.Null);

            Assert.That(bootstrapper.Container, Is.Not.Null);
        }
Ejemplo n.º 28
0
        public void ConfiguresWhenRun()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.NotNull(bootstrapper.ViewFactory);

            var view = bootstrapper.ViewFactory.Resolve <MockViewModel>();

            Assert.NotNull(view);

            Assert.NotNull(bootstrapper.Container);
        }
Ejemplo n.º 29
0
        public void RunShouldInitializeContainer()
        {
            var bootstrapper = new MockBootstrapper();
            var container    = bootstrapper.BaseContainer;

            Assert.Null(container);

            bootstrapper.Run();

            container = bootstrapper.BaseContainer;

            Assert.NotNull(container);
            Assert.IsType(ContainerHelper.BaseContainerType, container);
        }
Ejemplo n.º 30
0
        public void ConfiguresWhenRun()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.That(bootstrapper.ViewFactory, Is.Not.Null);

            var view = bootstrapper.ViewFactory.Resolve <MockViewModel>();

            Assert.That(view, Is.Not.Null);

            Assert.That(bootstrapper.Container, Is.Not.Null);
            Assert.That(bootstrapper.Container.ComponentRegistry.Registrations.Count(), Is.EqualTo(8));
        }