コード例 #1
0
 public void Load()
 {
     Utilities.FileFormats.INI.INI TestObject = new Utilities.FileFormats.INI.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"));
 }
コード例 #2
0
 public void Load()
 {
     Utilities.FileFormats.INI.INI TestObject = new Utilities.FileFormats.INI.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"));
 }
コード例 #3
0
 public void Delete()
 {
     Utilities.FileFormats.INI.INI TestObject = new Utilities.FileFormats.INI.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"));
 }
コード例 #4
0
 public void Delete()
 {
     Utilities.FileFormats.INI.INI TestObject = new Utilities.FileFormats.INI.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"));
 }
コード例 #5
0
        public void Write()
        {
            Utilities.FileFormats.INI.INI TestObject = new Utilities.FileFormats.INI.INI(@".\Testing\TestFile.ini");
            TestObject.WriteToINI("Section1", "Key3", "SpecialValue");

            TestObject = new Utilities.FileFormats.INI.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"));
        }
コード例 #6
0
        public void Write()
        {
            Utilities.FileFormats.INI.INI TestObject = new Utilities.FileFormats.INI.INI(@".\Testing\TestFile.ini");
            TestObject.WriteToINI("Section1", "Key3", "SpecialValue");

            TestObject = new Utilities.FileFormats.INI.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"));
        }