public void TestStr() { var a = CbVal.NewStr("123"); Assert.IsTrue(a.IsStr); Assert.AreEqual(a.Str, "123"); }
public void TestWord17() { var code = "12345e-1234-1234-1234-123456789abc"; Parser.RunInReader(code, code => { var r = Parser.Word(code).Value.Item2; Assert.AreEqual(CbVal.NewStr("12345e-1234-1234-1234-123456789abc"), r); }); }
public void TestWord1() { var code = "asd"; Parser.RunInReader(code, code => { var r = Parser.Word(code).Value.Item2; Assert.AreEqual(CbVal.NewStr("asd"), r); }); }
public void TestArr4() { var code = "['asd', null]"; Parser.RunInReader(code, code => { var r = Parser.ArrLoop(code).Value.Item2; Assert.AreEqual(new List <CbVal>() { CbVal.NewStr("asd"), CbVal.NewNull() }, r); }); }
public void TestArr3() { var code = "[ asd true ]"; Parser.RunInReader(code, code => { var r = Parser.ArrLoop(code).Value.Item2; Assert.AreEqual(new List <CbVal>() { CbVal.NewStr("asd"), CbVal.NewBool(true) }, r); }); }
public void TestObj5() { var code = "{ \"a\": \"123\", 'b' = '321' ; ; c asd }"; Parser.RunInReader(code, code => { var r = Parser.ObjLoop(code).Value.Item2; Assert.AreEqual(new Dictionary <string, CbVal>() { { "a", CbVal.NewStr("123") }, { "b", CbVal.NewStr("321") }, { "c", CbVal.NewStr("asd") } }, r); }); }