/// <summary>
        /// Initializes a new instance of <see cref="ConfigurationModuleEnumerator"/>.
        /// </summary>
        /// <param name="store">The <see cref="ConfigurationStore"/> to use to get the module configuration.</param>
        public ConfigurationModuleEnumerator(ConfigurationStore store)
        {
            if (store == null)
                throw new ArgumentNullException("store");

            this._store = store;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="ConfigurationModuleEnumerator"/>.
        /// </summary>
        /// <param name="store">The <see cref="ConfigurationStore"/> to use to get the module configuration.</param>
        public ConfigurationModuleEnumerator(ConfigurationStore store)
        {
            if (store == null)
            {
                throw new ArgumentNullException("store");
            }

            this._store = store;
        }
예제 #3
0
        public void ShouldRetrieveModuleConfiguration()
        {
            ConfigurationStore store = new ConfigurationStore();
            var section = store.RetrieveModuleConfigurationSection();

            Assert.IsNotNull(section);
            Assert.IsNotNull(section.Modules);
            Assert.AreEqual(1, section.Modules.Count);
            Assert.IsNotNull(section.Modules[0].AssemblyFile);
            Assert.AreEqual("MockModuleA", section.Modules[0].ModuleName);
            Assert.IsNotNull(section.Modules[0].AssemblyFile);
            Assert.IsTrue(section.Modules[0].AssemblyFile.Contains(@"MocksModules\MockModuleA.dll"));
            Assert.IsNotNull(section.Modules[0].ModuleType);
            Assert.IsTrue(section.Modules[0].StartupLoaded);
            Assert.AreEqual("Microsoft.Practices.Composite.Tests.Mocks.Modules.MockModuleA", section.Modules[0].ModuleType);
        }
        public void ReadsTwoModulesWithDependency()
        {
            ConfigurationStore store = new ConfigurationStore(@"Mocks\Configuration\TwoModulesWithDependency");

            ModulesConfigurationSection section = store.RetrieveModuleConfigurationSection();

            Assert.AreEqual(2, section.Modules.Count);
            Assert.AreEqual("MockModuleA", section.Modules[0].ModuleName);
            Assert.IsTrue(section.Modules[0].AssemblyFile.Contains(@"MocksModules\MockModuleA.dll"));
            Assert.AreEqual("Microsoft.Practices.Composite.Tests.Mocks.Modules.MockModuleA", section.Modules[0].ModuleType);
            Assert.IsTrue(section.Modules[0].StartupLoaded);
            Assert.AreEqual("MockModuleB", section.Modules[0].Dependencies[0].ModuleName);
            Assert.AreEqual("MockModuleB", section.Modules[1].ModuleName);
            Assert.IsTrue(section.Modules[1].AssemblyFile.Contains(@"MocksModules\MockModuleB.dll"));
            Assert.AreEqual("Microsoft.Practices.Composite.Tests.Mocks.Modules.MockModuleB", section.Modules[1].ModuleType);
            Assert.IsTrue((section.Modules[1].StartupLoaded));
        }