コード例 #1
0
        public void RefreshConfiguration()
        {
            string sectionName = "TestSection";

            DummySection configSection = new DummySection();
            configSection.Value = 20;
            SqlConfigurationSystem configSystem = new SqlConfigurationSystem(data);
            configSystem.SaveSection(sectionName, configSection);

            DateTime lastModDate1 = GetLastModDate(sectionName);
            System.Threading.Thread.Sleep(1000);
            configSystem.RefreshConfig(sectionName);
            DateTime lastModDate2 = GetLastModDate(sectionName);

            Assert.IsFalse(lastModDate2.Equals(lastModDate1));
        }
コード例 #2
0
        public void SaveAndGetTestConfiguration()
        {
            DummySection configSection = new DummySection();
            configSection.Value = 20;
            SqlConfigurationSystem configSystem = new SqlConfigurationSystem(data);
            configSystem.SaveSection("TestSection", configSection);

            DummySection configSection2 = configSystem.GetSection("TestSection") as DummySection;

            Assert.AreEqual(configSection2.Value, configSection.Value);
            
        }
コード例 #3
0
 public void SaveTestConfiguration()
 {
     DummySection configSection = new DummySection();
     configSection.Value = 20;
     SqlConfigurationSystem configSystem = new SqlConfigurationSystem(data);
     configSystem.SaveSection("TestSection",configSection);
     
     //Assert that the database now has one record
     Assert.IsTrue(GetNumberofConfigSections() == 1);
 }