コード例 #1
0
ファイル: BootstrapperFixture.cs プロジェクト: DT021/Prism-1
        public void ContainerDefaultsToNull()
        {
            var bootstrapper = new MockBootstrapper();
            var container    = bootstrapper.ContainerExtension;

            Assert.Null(container);
        }
コード例 #2
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++]);
        }
コード例 #3
0
        public void RunShouldNotFailIfReturnedNullShell()
        {
            var bootstrapper = new MockBootstrapper {
                ShellObject = null
            };

            bootstrapper.Run();
        }
コード例 #4
0
        public void RunShouldCallConfigureViewModelLocator()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureViewModelLocatorCalled);
        }
コード例 #5
0
        public void RunShouldCallInitializeModules()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.InitializeModulesCalled);
        }
コード例 #6
0
        public void RunShouldCallConfigureContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureContainerCalled);
        }
コード例 #7
0
        public void RunShouldCallConfigureModuleCatalog()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureModuleCatalogCalled);
        }
コード例 #8
0
        public void RunShouldCallRegisterTypes()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.RegisterTypesCalled);
        }
コード例 #9
0
        public void RunShouldCallConfigureDefaultRegionBehaviors()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);
        }
コード例 #10
0
        public void RunShouldCallConfigureRegionAdapterMappings()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.ConfigureRegionAdapterMappingsCalled);
        }
コード例 #11
0
        public void RunShouldAssignRegionManagerToReturnedShell()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.NotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));
        }
コード例 #12
0
ファイル: BootstrapperFixture.cs プロジェクト: DT021/Prism-1
        public void RegisterFrameworkExceptionTypesShouldRegisterResolutionFailedException()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.CallRegisterFrameworkExceptionTypes();

            Assert.True(ExceptionExtensions.IsFrameworkExceptionRegistered(RegisteredFrameworkException));
        }
コード例 #13
0
        public void RunShouldCallCreateLogger()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.True(bootstrapper.CreateLoggerCalled);
        }
コード例 #14
0
ファイル: BootstrapperFixture.cs プロジェクト: DT021/Prism-1
        public void CreateContainerShouldInitializeContainer()
        {
            var bootstrapper = new MockBootstrapper();

            var container = bootstrapper.CallCreateContainer();

            Assert.NotNull(container);
            Assert.IsAssignableFrom(BaseContainerInterfaceType, container);
        }
コード例 #15
0
        public void RunShouldLogLoggerCreationSuccess()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.LoggerCreatedSuccessfully));
        }
コード例 #16
0
        public void RunShouldLogAboutRunCompleting()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.BootstrapperSequenceCompleted));
        }
コード例 #17
0
        public void RunShouldLogAboutRegisteringFrameworkExceptionTypes()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.RegisteringFrameworkExceptionTypes));
        }
コード例 #18
0
        public void RunShouldLogAboutInitializingModules()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.InitializingModules));
        }
コード例 #19
0
        public void RunShouldLogAboutInitializingTheShellIfShellCreated()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.InitializingShell));
        }
コード例 #20
0
        public void RunShouldLogAboutConfiguringRegionBehaviors()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.ConfiguringDefaultRegionBehaviors));
        }
コード例 #21
0
        public void RunShouldLogAboutConfiguringViewModelLocator()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.ConfiguringViewModelLocator));
        }
コード例 #22
0
        public void RunSetsCurrentContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

            Assert.NotNull(ContainerLocator.Container);
            Assert.IsType(ContainerHelper.ContainerExtensionType, ContainerLocator.Container);
        }
コード例 #23
0
        public void RunShouldLogAboutCreatingTheContainer()
        {
            var bootstrapper = new MockBootstrapper();

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

            Assert.True(messages.Contains(ContainerResources.CreatingContainer));
        }
コード例 #24
0
        public void ConfigureContainerAddsLoggerFacadeToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

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

            Assert.NotNull(returnedCatalog);
        }
コード例 #25
0
        public void RunAddsCompositionContainerToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            var createdContainer  = bootstrapper.CallCreateContainer();
            var returnedContainer = createdContainer.Resolve <IUnityContainer>();

            Assert.NotNull(returnedContainer);
            Assert.Equal(typeof(UnityContainer), returnedContainer.GetType());
        }
コード例 #26
0
ファイル: BootstrapperFixture.cs プロジェクト: DT021/Prism-1
        public void ConfigureContainerAddsModuleCatalogToContainer()
        {
            var bootstrapper = new MockBootstrapper();

            bootstrapper.Run();

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

            Assert.NotNull(returnedCatalog);
            Assert.IsType <ModuleCatalog>(returnedCatalog);
        }
コード例 #27
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());
        }
コード例 #28
0
        public void RunShouldNotLogAboutInitializingTheShellIfShellIsNotCreated()
        {
            var bootstrapper = new MockBootstrapper {
                ShellObject = null
            };

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

            Assert.False(messages.Contains(ContainerResources.InitializingShell));
        }
コード例 #29
0
ファイル: BootstrapperFixture.cs プロジェクト: DT021/Prism-1
        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);
        }
コード例 #30
0
ファイル: BootstrapperFixture.cs プロジェクト: DT021/Prism-1
        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);
        }