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

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

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

            bootstrapper.Run();

            bootstrapper.ConfigureContainerCalled.ShouldBeTrue();
        }
Example #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();
        }
Example #14
0
        public void RunAddsDependencyRegistrarToContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

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

            returnedContainer.ShouldNotBeNull();
            returnedContainer.ShouldBeOfType <MunqContainerWrapper>();
        }
Example #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);
        }
Example #16
0
        public void RunAddsCompositionContainerToContainer()
        {
            var bootstrapper = new DefaultMunqBootstrapper();

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

            returnedContainer.ShouldNotBeNull();
            returnedContainer.ShouldBeOfType <MunqContainerWrapper>();
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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>();
        }
Example #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);
        }
Example #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>();
        }
Example #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();
        }