示例#1
0
        private void assertBoolParseFail(string json)
        {
            Assert.Throws <JsonParseException>(() => JsonBool.Parse(json));
            JsonBool val;

            Assert.IsFalse(JsonBool.TryParse(json, out val));
            Assert.IsNull(val);
        }
示例#2
0
        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);
        }