Example #1
0
        public void ConfigureModulesUsesModuleEnumeratorAndModuleLoaderService()
        {
            TestableWebClientApplication     app       = new TestableWebClientApplication();
            TestableRootCompositionContainer container = new TestableRootCompositionContainer();

            app.SetTestRootCompositionContainer(container);
            MockModuleEnumerator moduleEnumerator = new MockModuleEnumerator();

            ModuleInfo moduleInfo = new ModuleInfo("TestModuleName", string.Empty, string.Empty);

            moduleEnumerator.ModulesData.Add(moduleInfo);
            container.Services.Add(typeof(IModuleEnumerator), moduleEnumerator);

            MockModuleLoaderService moduleLoader = new MockModuleLoaderService();

            container.Services.Add(typeof(IModuleLoaderService), moduleLoader);

            MockModuleConfigurationLocatorService configurationLocator = new MockModuleConfigurationLocatorService();

            container.Services.Add(typeof(IModuleConfigurationLocatorService), configurationLocator);

            app.TestConfigureModules();

            Assert.AreEqual("TestModuleName", configurationLocator.ModuleName);
            Assert.AreEqual("TestModuleName", moduleLoader.ModuleName);
        }
Example #2
0
        public void AddRequiredServicesAddsModuleContainerLocatorService()
        {
            TestableWebClientApplication     app       = new TestableWebClientApplication();
            TestableRootCompositionContainer container = new TestableRootCompositionContainer();

            app.SetTestRootCompositionContainer(container);

            app.TestAddRequiredServices();

            container.Services.Contains <ModuleContainerLocatorService>();
        }
Example #3
0
        public void AddRequiredServicesAddsWebConfigModuleInfoStore()
        {
            TestableWebClientApplication     app       = new TestableWebClientApplication();
            TestableRootCompositionContainer container = new TestableRootCompositionContainer();

            app.SetTestRootCompositionContainer(container);

            app.TestAddRequiredServices();

            container.Services.Contains <WebConfigModuleInfoStore>();
        }
Example #4
0
        public void AddRequiredServicesAddsAuthorizationRulesService()
        {
            TestableWebClientApplication     app       = new TestableWebClientApplication();
            TestableRootCompositionContainer container = new TestableRootCompositionContainer();

            app.SetTestRootCompositionContainer(container);

            app.TestAddRequiredServices();

            container.Services.Contains <AuthorizationRulesService>();
        }
Example #5
0
        public void AddRequiredServicesAddsVirtualPathUtilityService()
        {
            TestableWebClientApplication     app       = new TestableWebClientApplication();
            TestableRootCompositionContainer container = new TestableRootCompositionContainer();

            app.SetTestRootCompositionContainer(container);

            app.TestAddRequiredServices();

            container.Services.Contains <VirtualPathUtilityService>();
        }
Example #6
0
        public void LoadModulesCallsModuleLoaderService()
        {
            TestableWebClientApplication app = new TestableWebClientApplication();

            app.SetTestRootCompositionContainer(new TestableRootCompositionContainer());

            IModuleLoaderService loaderService =
                app.RootContainer.Services.AddNew <MockModuleLoaderService, IModuleLoaderService>();

            app.RootContainer.Services.AddNew <MockModuleEnumerator, IModuleEnumerator>();

            app.TestLoadModules();

            Assert.IsTrue(((MockModuleLoaderService)loaderService).LoadCalled);
        }