public void ContainerDefaultsToNull()
        {
            var bootstrapper = new DefaultMunqBootstrapper();
            var container    = bootstrapper.Container;

            container.ShouldBeNull();
        }
Exemple #2
0
        public void RunShouldCallCreateShell()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.CreateShellCalled.ShouldBeTrue();
        }
Exemple #3
0
        public void RunShouldCallConfigureModuleCatalog()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.ConfigureModuleCatalogCalled.ShouldBeTrue();
        }
Exemple #4
0
        public void RunShouldAssignRegionManagerToReturnedShell()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            RegionManager.GetRegionManager(bootstrapper.BaseShell).ShouldNotBeNull();
        }
Exemple #5
0
        public void RunShouldCallConfigureRegionAdapterMappings()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.ConfigureRegionAdapterMappingsCalled.ShouldBeTrue();
        }
Exemple #6
0
        public void RunShouldCallConfigureDefaultRegionBehaviors()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.ConfigureDefaultRegionBehaviorsCalled.ShouldBeTrue();
        }
Exemple #7
0
        public void RunShouldCallInitializeModules()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.InitializeModulesCalled.ShouldBeTrue();
        }
Exemple #8
0
        public void RunShouldCallConfigureViewModelLocator()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.ConfigureViewModelLocatorCalled.ShouldBeTrue();
        }
Exemple #9
0
        public void RunConfiguresServiceLocatorProvider()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            ServiceLocator.Current.ShouldBeOfType <MunqServiceLocatorAdapter>();
        }
Exemple #10
0
        public void RunShouldCallConfigureContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

            bootstrapper.ConfigureContainerCalled.ShouldBeTrue();
        }
Exemple #11
0
        public void RunShouldNotFailIfReturnedNullShell()
        {
            var bootstrapper = new DefaultMunqBootstrapper {
                ShellObject = null
            };

            Should.NotThrow(() => bootstrapper.Run());
        }
        public void CreateContainerShouldInitializeContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            var container = bootstrapper.CallCreateContainer();

            container.ShouldNotBeNull();
            container.ShouldBeOfType <MunqContainerWrapper>();
        }
        public void ConfigureContainerAddsLoggerFacadeToContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

            bootstrapper.Run();

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

            returnedCatalog.ShouldNotBeNull();
        }
Exemple #14
0
        public void RunAddsDependencyRegistrarToContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

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

            returnedContainer.ShouldNotBeNull();
            returnedContainer.ShouldBeOfType <MunqContainerWrapper>();
        }
Exemple #15
0
        public void RunShouldLogAboutRunCompleting()
        {
            const string expectedMessageText = "Bootstrapper sequence completed.";
            var          bootstrapper        = new DefaultMunqBootstrapper();

            bootstrapper.Run();
            IList <string> messages = bootstrapper.BaseLogger.Messages;

            messages.ShouldContain(expectedMessageText);
        }
Exemple #16
0
        public void RunAddsCompositionContainerToContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

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

            returnedContainer.ShouldNotBeNull();
            returnedContainer.ShouldBeOfType <MunqContainerWrapper>();
        }
Exemple #17
0
        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);
        }
Exemple #18
0
        public void RunShouldLogAboutInitializingModules()
        {
            const string expectedMessageText = "Initializing modules.";
            var          bootstrapper        = new DefaultMunqBootstrapper();

            bootstrapper.Run();
            IList <string> messages = bootstrapper.BaseLogger.Messages;

            messages.ShouldContain(expectedMessageText);
        }
Exemple #19
0
        public void RunShouldLogAboutInitializingTheShellIfShellCreated()
        {
            const string expectedMessageText = "Initializing the shell.";
            var          bootstrapper        = new DefaultMunqBootstrapper();

            bootstrapper.Run();
            IList <string> messages = bootstrapper.BaseLogger.Messages;

            messages.ShouldContain(expectedMessageText);
        }
Exemple #20
0
        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);
        }
Exemple #21
0
        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);
        }
Exemple #22
0
        public void RunShouldLogAboutConfiguringModuleCatalog()
        {
            const string expectedMessageText = "Configuring module catalog.";
            var          bootstrapper        = new DefaultMunqBootstrapper();

            bootstrapper.Run();
            IList <string> messages = bootstrapper.BaseLogger.Messages;

            messages.ShouldContain(expectedMessageText);
        }
Exemple #23
0
        public void RunShouldLogAboutCreatingTheContainer()
        {
            const string expectedMessageText = "Creating Munq container.";
            var          bootstrapper        = new DefaultMunqBootstrapper();

            bootstrapper.Run();
            IList <string> messages = bootstrapper.BaseLogger.Messages;

            messages.ShouldContain(expectedMessageText);
        }
Exemple #24
0
        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>();
        }
Exemple #26
0
        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 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 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);
        }
Exemple #29
0
        public void RunShouldInitializeContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();
            var container    = bootstrapper.BaseContainer;

            container.ShouldBeNull();

            bootstrapper.Run();

            container = bootstrapper.BaseContainer;

            container.ShouldNotBeNull();
            container.ShouldBeOfType <MunqContainerWrapper>();
        }
Exemple #30
0
        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();
        }