public void MergesDuplicateSection() { var iniFile = new IniFile(new Sentence(), new IniSettings { DuplicateSectionHandling = DuplicateSectionHandling.Merge }); iniFile.AddSection("foo"); iniFile.AddSection("foo"); Assert.IsTrue(iniFile.Sections.Count() == 1); Assert.IsTrue(iniFile.Sections.Count(x => x == "foo") == 1); }
public void RendersIniWithoutFormattingOptions() { var iniFile = new IniFile(); var bar = iniFile.AddSection("bar"); bar.AddComment("foo"); bar.AddProperty("baz", "baaz"); bar.AddProperty("qux", "quux"); var baar = iniFile.AddSection("baar"); baar.AddProperty("baaz", "baaaz"); baar.AddProperty("quux", "quuux"); var iniText = IniRenderer.Render(iniFile.GlobalSection, FormattingOptions.None); }
public void AddsSection() { var iniFile = new IniFile(new Sentence()); var s1 = iniFile.AddSection("foo"); Assert.AreEqual(s1, iniFile["foo"]); Assert.AreEqual(s1, ((dynamic)iniFile).foo); }
public void DisallowsDuplicateSection() { var iniFile = new IniFile(new Sentence(), new IniSettings()); iniFile.AddSection("foo"); iniFile.AddSection("foo"); }