Beispiel #1
0
        public void RunShouldNotFailIfReturnedNullShell()
        {
            var bootstrapper = new DefaultGraceBootstrapper {
                ShellObject = null
            };

            bootstrapper.Run();
        }
Beispiel #2
0
        public void RunShouldCallConfigureRegionAdapterMappings()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureRegionAdapterMappingsCalled);
        }
Beispiel #3
0
        public void RunShouldCallConfigureDefaultRegionBehaviors()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);
        }
Beispiel #4
0
        public void RunShouldCallConfigureContainer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureContainerCalled);
        }
Beispiel #5
0
        public void RunShouldCallCreateShell()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.CreateShellCalled);
        }
Beispiel #6
0
        public void RunShouldCallConfigureModuleCatalog()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureModuleCatalogCalled);
        }
Beispiel #7
0
        public void RunShouldAssignRegionManagerToReturnedShell()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsNotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));
        }
Beispiel #8
0
        public void RunConfiguresServiceLocatorProvider()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(ServiceLocator.Current is GraceServiceLocatorAdapter);
        }
Beispiel #9
0
        public void RunShouldCallInitializeModules()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.InitializeModulesCalled);
        }
Beispiel #10
0
        public void RunShouldLogAboutConfiguringRegionBehaviors()
        {
            const string expectedMessageText = "Configuring default region behaviors.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #11
0
        public void RunShouldLogAboutInitializingModules()
        {
            const string expectedMessageText = "Initializing modules.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #12
0
        public void RunShouldLogAboutRegisteringFrameworkExceptionTypes()
        {
            const string expectedMessageText = "Registering Framework Exception Types.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #13
0
        public void RunShouldLogAboutConfiguringContainerBuilder()
        {
            const string expectedMessageText = "Configuring the Grace container.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #14
0
        public void RunShouldLogAboutRunCompleting()
        {
            const string expectedMessageText = "Bootstrapper sequence completed.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #15
0
        public void RunShouldLogAboutCreatingTheShell()
        {
            const string expectedMessageText = "Creating the shell.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #16
0
        public void RunShouldLogAboutConfiguringModuleCatalog()
        {
            const string expectedMessageText = "Configuring module catalog.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
Beispiel #17
0
        public void RunShouldLogLoggerCreationSuccess()
        {
            const string expectedMessageText = "Logger was created successfully.";
            var          bootstrapper        = new DefaultGraceBootstrapper();

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

            Assert.IsTrue(messages.Contains(expectedMessageText));
        }
        public void ConfigureContainerAddsLoggerFacadeToContainer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var returnedCatalog = bootstrapper.BaseContainer.Locate <ILoggerFacade>();

            Assert.IsNotNull(returnedCatalog);
        }
        public void ConfigureContainerAddsModuleCatalogToContainer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var returnedCatalog = bootstrapper.BaseContainer.Locate <IModuleCatalog>();

            Assert.IsNotNull(returnedCatalog);
            Assert.IsTrue(returnedCatalog is ModuleCatalog);
        }
Beispiel #20
0
        public void RunRegistersTypeForRegionAdapterMappings()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var regionAdapterMappings = bootstrapper.BaseContainer.Locate <RegionAdapterMappings>();

            Assert.IsNotNull(regionAdapterMappings);
            Assert.AreEqual(typeof(RegionAdapterMappings), regionAdapterMappings.GetType());
        }
Beispiel #21
0
        public void RunShouldNotLogAboutInitializingTheShellIfShellIsNotCreated()
        {
            const string expectedMessageText = "Initializing shell";
            var          bootstrapper        = new DefaultGraceBootstrapper {
                ShellObject = null
            };

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

            Assert.IsFalse(messages.Contains(expectedMessageText));
        }
Beispiel #22
0
        public void RunRegistersInstanceOfILoggerFacade()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var logger = bootstrapper.BaseContainer.Locate <ILoggerFacade>();

            Assert.IsNotNull(logger);
            Assert.IsTrue(logger.GetType().IsClass);
            Assert.IsTrue(logger.GetType().GetInterfaces().Contains(typeof(ILoggerFacade)));
        }
Beispiel #23
0
        public void RunRegistersTypeForIModuleInitializer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var moduleInitializer = bootstrapper.BaseContainer.Locate <IModuleInitializer>();

            Assert.IsNotNull(moduleInitializer);
            Assert.IsTrue(moduleInitializer.GetType().IsClass);
            Assert.IsTrue(moduleInitializer.GetType().GetInterfaces().Contains(typeof(IModuleInitializer)));
        }
Beispiel #24
0
        public void RunRegistersInstanceOfIModuleCatalog()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var moduleCatalog = bootstrapper.BaseContainer.Locate <IModuleCatalog>();

            Assert.IsNotNull(moduleCatalog);
            Assert.IsTrue(moduleCatalog.GetType().IsClass);
            Assert.IsTrue(moduleCatalog.GetType().GetInterfaces().Contains(typeof(IModuleCatalog)));
        }
Beispiel #25
0
        public void RunRegistersTypeForIRegionBehaviorFactory()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var regionBehaviorFactory = bootstrapper.BaseContainer.Locate <IRegionBehaviorFactory>();

            Assert.IsNotNull(regionBehaviorFactory);
            Assert.IsTrue(regionBehaviorFactory.GetType().IsClass);
            Assert.IsTrue(regionBehaviorFactory.GetType().GetInterfaces().Contains(typeof(IRegionBehaviorFactory)));
        }
Beispiel #26
0
        public void RunRegistersTypeForIEventAggregator()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var eventAggregator = bootstrapper.BaseContainer.Locate <IEventAggregator>();

            Assert.IsNotNull(eventAggregator);
            Assert.IsTrue(eventAggregator.GetType().IsClass);
            Assert.IsTrue(eventAggregator.GetType().GetInterfaces().Contains(typeof(IEventAggregator)));
        }
        public void ConfigureContainerAddsNavigationTargetHandlerToContainer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var actual1 = bootstrapper.BaseContainer.Locate <IRegionNavigationContentLoader>();
            var actual2 = bootstrapper.BaseContainer.Locate <IRegionNavigationContentLoader>();

            Assert.IsNotNull(actual1);
            Assert.IsNotNull(actual2);
            Assert.AreSame(actual1, actual2);
        }
Beispiel #28
0
        public void RunRegistersTypeForIServiceLocator()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var serviceLocator = bootstrapper.BaseContainer.Locate <IServiceLocator>();

            Assert.IsNotNull(serviceLocator);
            Assert.IsTrue(serviceLocator.GetType().IsClass);
            Assert.AreEqual(typeof(GraceServiceLocatorAdapter), serviceLocator.GetType());
            Assert.IsTrue(serviceLocator.GetType().GetInterfaces().Contains(typeof(IServiceLocator)));
        }
        public void ConfigureContainerAddsRegionNavigationJournalToContainer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();

            bootstrapper.Run();

            var actual1 = bootstrapper.BaseContainer.Locate <IRegionNavigationJournal>();
            var actual2 = bootstrapper.BaseContainer.Locate <IRegionNavigationJournal>();

            Assert.IsNotNull(actual1);
            Assert.IsNotNull(actual2);
            Assert.AreNotSame(actual1, actual2);
        }
Beispiel #30
0
        public void RunShouldInitializeContainer()
        {
            var bootstrapper = new DefaultGraceBootstrapper();
            var container    = bootstrapper.BaseContainer;

            Assert.IsNull(container);

            bootstrapper.Run();

            container = bootstrapper.BaseContainer;

            Assert.IsNotNull(container);
            Assert.IsInstanceOfType(container, typeof(DependencyInjectionContainer));
        }