public void TestMultipleSectionsWithProperties() { var builder = new BuiltSectionCollection(IniOptions.Default); builder.StartSection("section1"); builder.AddProperty("value", 10L); builder.StartSection("section2"); builder.AddProperty("value", 10L); var built = builder.SerialiseToString(); Assert.AreEqual("[section1]\nvalue=10\n[section2]\nvalue=10\n", built); }
public void TestDefaultSectionBlockCaseInvariant() { var builder = new BuiltSectionCollection(IniOptions.Default); Assert.Throws <ArgumentException>(() => builder.StartSection(Section.DefaultSectionName.ToUpperInvariant())); }
/// <summary> /// Start a new section /// </summary> /// <param name="name">The section's name</param> /// <param name="comment">Optional comment for the section</param> public void StartSection(string name, string comment = null) { sectionCollection.StartSection(name, comment); }