Example #1
0
        public void Ini_Add_AddDicEntry_ExistingVar()
        {
            parser = new IniParser(File1ContentRaw);
            bool add = parser.AddDicEntry("head", "var", "valueX");

            Assert.IsFalse(add, "Adding the dicEntry should return false");

            // fetch should work with the old value
            string result1 = parser.GetValue("head", "var");

            Assert.AreEqual(result1, "val", "Value is not as expected");
        }
Example #2
0
        public void Ini_Add_AddDicEntry_NonExistingHeader()
        {
            parser = new IniParser(File1ContentRaw);
            bool add = parser.AddDicEntry("headX", "var", "val");

            Assert.IsFalse(add, "Adding the dicEntry should return false");

            // fetch should return empty since the header doesn't exist
            string result1 = parser.GetValue("head3", "var");

            Assert.AreEqual(result1, "", "Value is not as expected");
        }
Example #3
0
        public void Ini_Add_AddDicEntry_New()
        {
            parser = new IniParser(File1ContentRaw);
            bool add = parser.AddDicEntry("head", "varX", "valueX");

            Assert.IsTrue(add, "Adding the dicEntry should return true");

            // fetch should work
            string result1 = parser.GetValue("head", "varX");

            Assert.AreEqual(result1, "valueX", "Value is not as expected");
        }