Exemplo n.º 1
0
 public void Load()
 {
     var TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");
     Assert.Equal("Value1", TestObject.ReadFromINI("Section1", "Key1"));
     Assert.Equal("Value2", TestObject.ReadFromINI("Section1", "Key2"));
     Assert.Equal("Value3", TestObject.ReadFromINI("Section2", "Key1"));
     Assert.Equal("Value4", TestObject.ReadFromINI("Section2", "Key2"));
 }
        public void Load()
        {
            var TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");

            Assert.Equal("Value1", TestObject.ReadFromINI("Section1", "Key1"));
            Assert.Equal("Value2", TestObject.ReadFromINI("Section1", "Key2"));
            Assert.Equal("Value3", TestObject.ReadFromINI("Section2", "Key1"));
            Assert.Equal("Value4", TestObject.ReadFromINI("Section2", "Key2"));
        }
Exemplo n.º 3
0
 public void Delete()
 {
     var TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");
     Assert.True(TestObject.DeleteFromINI("Section1"));
     Assert.Equal("", TestObject.ReadFromINI("Section1", "Key1"));
     Assert.Equal("", TestObject.ReadFromINI("Section1", "Key2"));
     Assert.True(TestObject.DeleteFromINI("Section2", "Key1"));
     Assert.Equal("", TestObject.ReadFromINI("Section2", "Key1"));
     Assert.Equal("Value4", TestObject.ReadFromINI("Section2", "Key2"));
 }
        public void Delete()
        {
            var TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");

            Assert.True(TestObject.DeleteFromINI("Section1"));
            Assert.Equal("", TestObject.ReadFromINI("Section1", "Key1"));
            Assert.Equal("", TestObject.ReadFromINI("Section1", "Key2"));
            Assert.True(TestObject.DeleteFromINI("Section2", "Key1"));
            Assert.Equal("", TestObject.ReadFromINI("Section2", "Key1"));
            Assert.Equal("Value4", TestObject.ReadFromINI("Section2", "Key2"));
        }
Exemplo n.º 5
0
        public void Write()
        {
            var TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");
            TestObject.WriteToINI("Section1", "Key3", "SpecialValue");

            TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");
            Assert.Equal("Value1", TestObject.ReadFromINI("Section1", "Key1"));
            Assert.Equal("Value2", TestObject.ReadFromINI("Section1", "Key2"));
            Assert.Equal("SpecialValue", TestObject.ReadFromINI("Section1", "Key3"));
            Assert.Equal("Value3", TestObject.ReadFromINI("Section2", "Key1"));
            Assert.Equal("Value4", TestObject.ReadFromINI("Section2", "Key2"));
        }
        public void Write()
        {
            var TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");

            TestObject.WriteToINI("Section1", "Key3", "SpecialValue");

            TestObject = new Utilities.IO.FileFormats.INI(@".\Testing\TestFile.ini");
            Assert.Equal("Value1", TestObject.ReadFromINI("Section1", "Key1"));
            Assert.Equal("Value2", TestObject.ReadFromINI("Section1", "Key2"));
            Assert.Equal("SpecialValue", TestObject.ReadFromINI("Section1", "Key3"));
            Assert.Equal("Value3", TestObject.ReadFromINI("Section2", "Key1"));
            Assert.Equal("Value4", TestObject.ReadFromINI("Section2", "Key2"));
        }