//**************************************************************************************************** // //**************************************************************************************************** static public void UnitTest() { JSon json = new JSon(); bool result = json.Parse("{ \"menu\":{\"test\":\"expression with \"quotes\"\",\"id\":\"file\",\"value\":\"File\",\"popup\":{\"menuitem\":[{\"value\":\"New\",\"onclick\":\"CreateNewDoc()\"},{\"value\":\"Open\",\"onclick\":\"OpenDoc()\"},{\"value\":\"Close\",\"onclick\":\"CloseDoc()\"}]}}}"); Debug.Assert(result == true); if (result) { string value = json["menu.popup.menuitem.[2].onclick"].value; bool success = (value != null) && (value.CompareTo("CloseDoc()") == 0); Debug.Assert(success); } }