public void IfModuleIsLoadedDoesNotLoadItAgain()
        {
            WebConfigModuleInfoStore store = new WebConfigModuleInfoStore(@"Services\Support\WebConfigWithRepeatedModules");

            ModulesConfigurationSection section = store.GetModuleConfigurationSection();

            Assert.AreEqual(1, section.Modules.Count);
        }
        private DependantModuleInfo[] GetModuleInfoCollection()
        {
            string path = (new System.IO.DirectoryInfo(@".\Support\MockWebsite")).FullName;
            WebConfigModuleInfoStore store            = new WebConfigModuleInfoStore(path);
            WebModuleEnumerator      moduleEnumerator = new WebModuleEnumerator(store);

            return((DependantModuleInfo[])moduleEnumerator.EnumerateModules());
        }
        public void ReadsTwoModulesFromTwoFiles()
        {
            WebConfigModuleInfoStore store = new WebConfigModuleInfoStore(@"Services\Support\TwoFiles");

            ModulesConfigurationSection section = store.GetModuleConfigurationSection();

            Assert.AreEqual(2, section.Modules.Count);
            Assert.AreEqual("Module1.Name", section.Modules[0].Name);
            Assert.AreEqual("Module1.AssemblyName", section.Modules[0].AssemblyName);
            Assert.AreEqual("Module1.VirtualPath", section.Modules[0].VirtualPath);
            Assert.AreEqual("Module2.Name", section.Modules[1].Name);
            Assert.AreEqual("Module2.AssemblyName", section.Modules[1].AssemblyName);
            Assert.AreEqual("Module2.VirtualPath", section.Modules[1].VirtualPath);
        }
        public void ReadsOneModuleWebConfig()
        {
            WebConfigModuleInfoStore store = new WebConfigModuleInfoStore(@"Services\Support\OneModule");

            ModulesConfigurationSection section = store.GetModuleConfigurationSection();

            Assert.AreEqual(1, section.Modules.Count);
            Assert.AreEqual("Module1.Name", section.Modules[0].Name);
            Assert.AreEqual("Module1.AssemblyName", section.Modules[0].AssemblyName);
            Assert.AreEqual("Module1.VirtualPath", section.Modules[0].VirtualPath);
            Assert.AreEqual(1, section.Modules[0].Services.Count);
            Assert.AreEqual(typeof(IFoo), section.Modules[0].Services[0].RegisterAs);
            Assert.AreEqual(typeof(Foo), section.Modules[0].Services[0].Type);
            Assert.AreEqual("Global", section.Modules[0].Services[0].Scope);
        }