コード例 #1
0
        public void RunShouldCallConfigureContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureContainerCalled);
        }
コード例 #2
0
        public void RunShouldCallConfigureViewModelLocator()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureViewModelLocatorCalled);
        }
コード例 #3
0
        public void RunShouldCallCreateLogger()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.CreateLoggerCalled);
        }
コード例 #4
0
        public void RunShouldCallCreateAggregateCatalog()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.CreateAggregateCatalogCalled);
        }
コード例 #5
0
        public void RunConfiguresServiceLocatorProvider()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(Microsoft.Practices.ServiceLocation.ServiceLocator.Current is MefServiceLocatorAdapter);
        }
コード例 #6
0
        public void RunShouldCallConfigureModuleCatalog()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureModuleCatalogCalled);
        }
コード例 #7
0
        public void RunShouldCallConfigureDefaultRegionBehaviors()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);
        }
コード例 #8
0
        public void RunShouldNotCallInitializeShellWhenShellNotCreated()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsFalse(bootstrapper.InitializeShellCalled);
        }
コード例 #9
0
        public void RunShouldCallRegisterFrameworkExceptionTypes()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.RegisterFrameworkExceptionTypesCalled);
        }
コード例 #10
0
        public void RunShouldCallCreateContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.CreateContainerCalled);
        }
コード例 #11
0
        public void RunShouldCallConfigureRegionAdapterMappings()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureRegionAdapterMappingsCalled);
        }
コード例 #12
0
        public void RunShouldCallConfigureDefaultRegionBehaviors()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureDefaultRegionBehaviorsCalled);
        }
コード例 #13
0
        public void RunConfiguresServiceLocatorProvider()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(CommonServiceLocator.ServiceLocator.Current is MefServiceLocatorAdapter);
        }
コード例 #14
0
        public void RunConfiguresServiceLocatorProvider()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(Microsoft.Practices.ServiceLocation.ServiceLocator.Current is MefServiceLocatorAdapter);
        }
コード例 #15
0
        public void RunShouldCallConfigureViewModelLocator()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureViewModelLocatorCalled);
        }
コード例 #16
0
        public void RunShouldCallCreateAggregateCatalog()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.CreateAggregateCatalogCalled);
        }
コード例 #17
0
        public void RunShouldCallConfigureModuleCatalog()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureModuleCatalogCalled);
        }
コード例 #18
0
        public void RunShouldCallInitializeModules()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.InitializeModulesCalled);
        }
コード例 #19
0
        public void RunShouldAssignRegionManagerToReturnedShell()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.ShellObject = new UserControl();

            bootstrapper.Run();

            Assert.IsNotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));
        }
コード例 #20
0
        public void RunShouldLogAboutInitializingModules()
        {
            const string expectedMessageText = "Initializing modules";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #21
0
        public void RunShouldLogAboutRunCompleting()
        {
            const string expectedMessageText = "Bootstrapper sequence completed";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #22
0
        public void RunShouldNotLogAboutInitializingTheShellIfShellIsNotCreated()
        {
            const string expectedMessageText = "Initializing shell";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsFalse(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #23
0
        public void RunShouldLogLoggerCreationSuccess()
        {
            const string expectedMessageText = "Logger was created successfully.";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #24
0
        public void RunShouldLogAboutConfiguringRegionBehaviors()
        {
            const string expectedMessageText = "Configuring default region behaviors";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #25
0
        public void RunShouldLogAboutCreatingTheShell()
        {
            const string expectedMessageText = "Creating shell";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #26
0
        public void RunShouldLogAboutRegisteringFrameworkExceptionTypes()
        {
            const string expectedMessageText = "Registering Framework Exception Types";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #27
0
        public void RunShouldLogAboutConfiguringViewModelLocator()
        {
            const string expectedMessageText = "Configuring the ViewModelLocator to use MEF";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #28
0
        public void RunShouldLogAboutConfiguringContainer()
        {
            const string expectedMessageText = "Configuring MEF container";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #29
0
        public void RunShouldLogAboutAggregateCatalogCreation()
        {
            const string expectedMessageText = "Creating catalog for MEF";
            var          bootstrapper        = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #30
0
        public void SingleRegionActiveAwareBehaviorIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <RegionActiveAwareBehavior>();

            Assert.IsNotNull(exported);
        }
コード例 #31
0
        public void SingleIRegionBehaviorFactoryIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <IRegionBehaviorFactory>();

            Assert.IsNotNull(exported);
        }
コード例 #32
0
        public void RegionLifetimeBehaviorIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <RegionMemberLifetimeBehavior>();

            Assert.IsNotNull(exported);
        }
コード例 #33
0
        public void SingleNavigationTargetHandlerIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <IRegionNavigationContentLoader>();

            Assert.IsNotNull(exported);
        }
コード例 #34
0
        public void SingleSyncRegionContextWithHostBehaviorIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <SyncRegionContextWithHostBehavior>();

            Assert.IsNotNull(exported);
        }
コード例 #35
0
        public void SingleIEventAggregatorIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <IEventAggregator>();

            Assert.IsNotNull(exported);
        }
コード例 #36
0
        public void RunShouldAssignRegionManagerToReturnedShell()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.ShellObject = new UserControl();

            bootstrapper.Run();

            Assert.IsNotNull(RegionManager.GetRegionManager(bootstrapper.BaseShell));
        }
コード例 #37
0
        public void SingleBindRegionContextToDependencyObjectBehaviorIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <BindRegionContextToDependencyObjectBehavior>();

            Assert.IsNotNull(exported);
        }
コード例 #38
0
        public void SingleItemsControlRegionAdapterIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue <ItemsControlRegionAdapter>();

            Assert.IsNotNull(exported);
        }
コード例 #39
0
        public void RunShouldLogAboutCreatingTheShell()
        {
            const string expectedMessageText = "Creating shell";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #40
0
        public void RunShouldLogAboutUpdatingRegions()
        {
            const string expectedMessageText = "Updating Regions.";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.ShellObject = new UserControl();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #41
0
        public void RunShouldLogAboutRegisteringFrameworkExceptionTypes()
        {
            const string expectedMessageText = "Registering Framework Exception Types";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #42
0
        public void RunShouldCallRegisterFrameworkExceptionTypes()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.RegisterFrameworkExceptionTypesCalled);
        }
コード例 #43
0
        public void RunShouldCallTheMethodsInOrder()
        {
            var bootstrapper = new DefaultMefBootstrapper{ShellObject = new UserControl()};
            bootstrapper.Run();

            Assert.AreEqual("CreateLogger", bootstrapper.MethodCalls[0]);
            Assert.AreEqual("CreateModuleCatalog", bootstrapper.MethodCalls[1]);
            Assert.AreEqual("ConfigureModuleCatalog", bootstrapper.MethodCalls[2]);
            Assert.AreEqual("CreateAggregateCatalog", bootstrapper.MethodCalls[3]);
            Assert.AreEqual("ConfigureAggregateCatalog", bootstrapper.MethodCalls[4]);
            Assert.AreEqual("CreateContainer", bootstrapper.MethodCalls[5]);
            Assert.AreEqual("ConfigureContainer", bootstrapper.MethodCalls[6]);
            Assert.AreEqual("ConfigureServiceLocator", bootstrapper.MethodCalls[7]);
            Assert.AreEqual("ConfigureViewModelLocator", bootstrapper.MethodCalls[8]);
            Assert.AreEqual("ConfigureRegionAdapterMappings", bootstrapper.MethodCalls[9]);
            Assert.AreEqual("ConfigureDefaultRegionBehaviors", bootstrapper.MethodCalls[10]);
            Assert.AreEqual("RegisterFrameworkExceptionTypes", bootstrapper.MethodCalls[11]);
            Assert.AreEqual("CreateShell", bootstrapper.MethodCalls[12]);
            Assert.AreEqual("InitializeShell", bootstrapper.MethodCalls[13]);
            Assert.AreEqual("InitializeModules", bootstrapper.MethodCalls[14]);
        }
コード例 #44
0
        public void RunShouldLogAboutInitializingModules()
        {
            const string expectedMessageText = "Initializing modules";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #45
0
        public void RunShouldLogAboutAggregateCatalogCreation()
        {
            const string expectedMessageText = "Creating catalog for MEF";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #46
0
 public void CanRunBootstrapper()
 {
     var bootstrapper = new DefaultMefBootstrapper();
     bootstrapper.Run();
 }
コード例 #47
0
        public void RunShouldLogLoggerCreationSuccess()
        {
            const string expectedMessageText = "Logger was created successfully.";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #48
0
        public void RegionNavigationJournalEntryIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            var actual1 = bootstrapper.BaseContainer.GetExportedValue<IRegionNavigationJournalEntry>();
            var actual2 = bootstrapper.BaseContainer.GetExportedValue<IRegionNavigationJournalEntry>();

            Assert.IsNotNull(actual1);
            Assert.IsNotNull(actual2);
            Assert.AreNotSame(actual1, actual2);
        }
コード例 #49
0
        public void SingleNavigationTargetHandlerIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue<IRegionNavigationContentLoader>();
            Assert.IsNotNull(exported);
        }       
コード例 #50
0
        public void RunShouldCallInitializeShellWhenShellSucessfullyCreated()
        {
            var bootstrapper = new DefaultMefBootstrapper
                                   {

                                       ShellObject = new UserControl()
                                   };

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.InitializeShellCalled);
        }       
コード例 #51
0
        public void RunShouldLogAboutInitializingTheShellIfShellCreated()
        {
            const string expectedMessageText = "Initializing shell";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.ShellObject = new UserControl();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #52
0
        public void RunShouldLogAboutConfiguringContainer()
        {
            const string expectedMessageText = "Configuring MEF container";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #53
0
        public void RunShouldNotLogAboutInitializingTheShellIfShellIsNotCreated()
        {
            const string expectedMessageText = "Initializing shell";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsFalse(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }       
コード例 #54
0
        public void RunShouldLogAboutConfiguringViewModelLocator()
        {
            const string expectedMessageText = "Configuring the ViewModelLocator to use MEF";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #55
0
        public void RunShouldLogAboutRunCompleting()
        {
            const string expectedMessageText = "Bootstrapper sequence completed";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #56
0
        public void RunShouldLogAboutConfiguringRegionBehaviors()
        {
            const string expectedMessageText = "Configuring default region behaviors";
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.TestLog.LogMessages.Contains(expectedMessageText));
        }
コード例 #57
0
        public void RunShouldNotCallInitializeShellWhenShellNotCreated()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsFalse(bootstrapper.InitializeShellCalled);
        }        
コード例 #58
0
        public void RunShouldCallConfigureRegionAdapterMappings()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.ConfigureRegionAdapterMappingsCalled);
        }
コード例 #59
0
        public void RegionLifetimeBehaviorIsRegisteredWithContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            var exported = bootstrapper.BaseContainer.GetExportedValue<RegionMemberLifetimeBehavior>();
            Assert.IsNotNull(exported);
        }
コード例 #60
0
        public void RunShouldCallInitializeModules()
        {
            var bootstrapper = new DefaultMefBootstrapper();
            bootstrapper.Run();

            Assert.IsTrue(bootstrapper.InitializeModulesCalled);
        }