public void ReadMultipleTest() { Delete(); var configFile = new ConfigFile <Configuration>(FilePath); var one = new TestConfigSection() { Value = 1 }; var two = new AnotherConfigSection() { Number = 2 }; var three = new AThirdSection() { Int = 3 }; configFile.Write(one, two, three); var read = configFile.Read <TestConfigSection, AnotherConfigSection>(); Assert.AreEqual(1, read.Find <TestConfigSection>().Value); Assert.AreEqual(2, read.Find <AnotherConfigSection>().Number); read = configFile.Read <TestConfigSection, AnotherConfigSection, AThirdSection>(); Assert.AreEqual(1, read.Find <TestConfigSection>().Value); Assert.AreEqual(2, read.Find <AnotherConfigSection>().Number); Assert.AreEqual(3, read.Find <AThirdSection>().Int); }
public void DeleteSectionTest() { Delete(); var configFile = new ConfigFile <Configuration>(FilePath); var another = new AnotherConfigSection(); var test = new TestConfigSection() { Value = 155 }; configFile.Write(another, test); Assert.AreEqual(155, configFile.Read <TestConfigSection>().Value); configFile.DeleteSection <TestConfigSection>(); Assert.AreEqual(15, configFile.Read <AnotherConfigSection>().Number); Assert.AreEqual(9, configFile.Read <TestConfigSection>().Value); }