Пример #1
0
        public void FirstRequestForSectionCreatesWatcher()
        {
            SqlConfigurationSourceImplementation implementation = new SqlConfigurationSourceImplementation(this.data, true);

            object section = implementation.GetSection(localSection);

            Assert.IsNotNull(section);
            Assert.AreEqual(1, implementation.WatchedConfigSources.Count);
            Assert.IsTrue(implementation.WatchedConfigSources.Contains(externalSectionSource));
            Assert.AreEqual(1, implementation.WatchedSections.Count);
            Assert.IsTrue(implementation.WatchedSections.Contains(localSection));

            Assert.IsNotNull(implementation.ConfigSourceWatcherMappings[externalSectionSource].Watcher);
            Assert.AreEqual(implementation.ConfigSourceWatcherMappings[externalSectionSource].Watcher.GetType(), typeof(ConfigurationChangeSqlWatcher));

            implementation.Dispose();
        }
        public void FirstRequestForSectionCreatesWatcher()
        {
            SqlConfigurationSourceImplementation implementation = new SqlConfigurationSourceImplementation(this.data, true);

            object section = implementation.GetSection(localSection);

            Assert.IsNotNull(section);
            Assert.AreEqual(1, implementation.WatchedConfigSources.Count);
            Assert.IsTrue(implementation.WatchedConfigSources.Contains(externalSectionSource));
            Assert.AreEqual(1, implementation.WatchedSections.Count);
            Assert.IsTrue(implementation.WatchedSections.Contains(localSection));

            Assert.IsNotNull(implementation.ConfigSourceWatcherMappings[externalSectionSource].Watcher);
            Assert.AreEqual(implementation.ConfigSourceWatcherMappings[externalSectionSource].Watcher.GetType(), typeof(ConfigurationChangeSqlWatcher));

            implementation.Dispose();
        }