public void TestUnion() { var a = CbVal.NewUnion(new CbUnion("asd", CbVal.NewNull())); Assert.IsTrue(a.IsUnion); Assert.AreEqual(a.Union, new CbUnion("asd", CbVal.NewNull())); }
public void TestObj() { var a = CbVal.NewObj(new Dictionary <string, CbVal> { { "asd", CbVal.NewNull() } }); Assert.IsTrue(a.IsObj); Assert.AreEqual(a.Obj, new Dictionary <string, CbVal> { { "asd", CbVal.NewNull() } }); }
public void TestArr() { var a = CbVal.NewArr(new List <CbVal> { CbVal.NewNull() }); Assert.IsTrue(a.IsArr); Assert.AreEqual(a.Arr, new List <CbVal> { CbVal.NewNull() }); }
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 TestObj4() { var code = "{ a false b null }"; Parser.RunInReader(code, code => { var r = Parser.ObjLoop(code).Value.Item2; Assert.AreEqual(new Dictionary <string, CbVal>() { { "a", CbVal.NewBool(false) }, { "b", CbVal.NewNull() } }, r); }); }
public void TestNull() { var a = CbVal.NewNull(); Assert.IsTrue(a.IsNull); }