예제 #1
0
 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
 }
예제 #2
0
 public void deserializeJSONWithMissingComma()
 {
     // TEMPLATE:
     //{
     //    "devise": {
     //        "appVersionId": 51,
     //        "locale": "en",
     //        "countryCode": "CZ"
     //        "platform": 1,
     //        "platformVersion": 7000005
     //    }
     //}
     //
     pr = parser.generateRequest("{ \"devise\": { \"appVersionId\": 51, \"locale\": \"en\", \"countryCode\": \"CZ\" \"platform\": 1, \"platformVersion\": 7000005 } }", null);
     Assert.IsFalse(pr.isSuccess());
     Assert.AreEqual(pr.getErrors().Count, 1);
 }