private void assertBoolParseFail(string json) { Assert.Throws <JsonParseException>(() => JsonBool.Parse(json)); JsonBool val; Assert.IsFalse(JsonBool.TryParse(json, out val)); Assert.IsNull(val); }
private void assertBoolParseSucc(string json, bool val) { JsonBool t = null; Assert.DoesNotThrow(() => { t = JsonBool.Parse(json); }); Assert.AreEqual(val, (bool)t); Assert.IsTrue(JsonBool.TryParse(json, out t)); Assert.AreEqual(val, (bool)t); }