Ejemplo n.º 1
0
 public void TestInvalidCommentableIdentifier()
 {
     using (var reader = new IniReader("basic.ini", IniOptions.Default))
     {
         Assert.Multiple(() =>
         {
             Assert.Throws <InvalidPropertyIdentifierException>(() => reader.GetComment("too.many.arguments"));
             Assert.Throws <InvalidPropertyIdentifierException>(() => reader.GetComment(""));
         });
     }
 }
Ejemplo n.º 2
0
        public void TestExplicitGetCommentForDefaultSection(
            [Values] bool caseSensitive,
            [Values] bool allowValueConversion,
            [Values] bool allowLooseProperties)
        {
            var options = new IniOptions(
                caseSensitive: caseSensitive,
                allowValueConversion: allowValueConversion,
                allowLooseProperties: allowLooseProperties);

            using (var reader = new IniReader("basic.ini", options))
            {
                Assert.AreEqual("comment\ncomment", reader.GetComment($"{Section.DefaultSectionName}.nosection"));
            }
        }
Ejemplo n.º 3
0
        public void TestGetCommentForProperty(
            [Values] bool caseSensitive,
            [Values] bool allowValueConversion,
            [Values] bool allowLooseProperties)
        {
            var options = new IniOptions(
                caseSensitive: caseSensitive,
                allowValueConversion: allowValueConversion,
                allowLooseProperties: allowLooseProperties);

            using (var reader = new IniReader("basic.ini", options))
            {
                Assert.AreEqual("property", reader.GetComment("Section.string"));
            }
        }