public void Delete()
        {
            var standardConfig = new ConfigHandling();

            standardConfig["test"] = 1024;
            standardConfig.Delete("test");
            Assert.IsEmpty(standardConfig["test"]);
        }
Beispiel #2
0
 public void test_Cleanup()
 {
     Monitor.Exit(IntegrationTestsSynchronization.LockObject);
     sqldata_.Dispose();
     sqldata_ = null;
     cfg_     = null;
     GC.Collect();
 }
Beispiel #3
0
 public void test_Init()
 {
     Monitor.Enter(IntegrationTestsSynchronization.LockObject);
     try
     {
         cfg_     = new ConfigHandling();
         sqldata_ = new mvOSQLDataHandling(cfg_.DatabaseName(), cfg_.ConnectionString());
     }
     catch (Exception ex)
     {
         Assert.Fail(string.Format("An exception has been thrown: {0}", ex.Message));
     }
 }
        public void ReferenceTypes()
        {
            ConfigHandling standardConfig = new ConfigHandling();

            string referenceString = "referenced string";

            string[] referenceArray = { "referenced", "string" };

            standardConfig["testString"] = referenceString;
            standardConfig["testArray"]  = referenceArray;

            Assert.AreEqual(referenceString, standardConfig["testString"]);
            Assert.AreEqual(referenceArray, standardConfig["testArray"]);
        }
        public void SavingLoading()
        {
            int value = 1024;
            {
                var standardConfig = new ConfigHandling {
                    ["test"] = value
                };
                standardConfig.Save();
            }

            {
                var standardConfig = new ConfigHandling();

                Assert.AreEqual(value, standardConfig["test"]);
            }
        }
        public void ValueTypes()
        {
            var standardConfig = new ConfigHandling();

            int valueInteger = 5000;

            standardConfig["testInteger"] = valueInteger;

            DateTime valueDate = DateTime.Now;

            standardConfig["testDate"] = valueDate;

            char valueChar = 'x';

            standardConfig["testChar"] = valueChar;

            Assert.AreEqual(valueDate, standardConfig["testDate"]);
            Assert.AreEqual(valueInteger, standardConfig["testInteger"]);
            Assert.AreEqual(valueChar, standardConfig["testChar"]);
        }