public void complexParseHeader() { pr = Parser.parseHeader("Simple $unknown_var$ string. It costs $x$\\$ and $ is money.", custom_variables); Assert.IsFalse(pr.isSuccess()); Assert.AreEqual(pr.getResult(), "Simple $unknown_var$ string. It costs 42$ and $ is money."); Assert.AreEqual(pr.getErrors().Count, 2); // one error for unknown variable and the other for unescaped dollar char at the end missing it's pair }
public void simpleParseHeader() { pr = Parser.parseHeader("", null); Assert.IsTrue(pr.isSuccess()); Assert.AreEqual(pr.getResult(), ""); pr = Parser.parseHeader("simple $first$ string", custom_variables); Assert.IsTrue(pr.isSuccess()); Assert.AreEqual(pr.getResult(), "simple second string"); pr = Parser.parseHeader("\\\\$", custom_variables); Assert.IsTrue(pr.isSuccess()); Assert.AreEqual(pr.getResult(), "\\$"); }