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 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 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")); }