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("")); }); } }
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")); } }
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")); } }