Beispiel #1
0
        public void TestOmittedDefaultSection()
        {
            var builder = new BuiltSectionCollection(IniOptions.Default);

            builder.AddProperty("value", 10L);
            builder.StartSection("section2");
            builder.AddProperty("value", 10L);

            var built = builder.SerialiseToString();

            Assert.AreEqual("value=10\n[section2]\nvalue=10\n", built);
        }
Beispiel #2
0
        public void TestDefaultSectionBlockCaseInvariant()
        {
            var builder = new BuiltSectionCollection(IniOptions.Default);

            Assert.Throws <ArgumentException>(() => builder.StartSection(Section.DefaultSectionName.ToUpperInvariant()));
        }
Beispiel #3
0
        public void TestInvalidPropertyType()
        {
            var builder = new BuiltSectionCollection(IniOptions.Default);

            Assert.Throws <ArgumentException>(() => builder.AddProperty("invalid", new DateTime(1970, 1, 1)));
        }
Beispiel #4
0
 private IniWriter(IniOptions options)
 {
     sectionCollection = new BuiltSectionCollection(options);
 }