public void Test_0017_JSONObjectValue_hasEntry() { JsonObject json = new JsonObject("{\"user\":{\"name\":\"kii\"}}"); Assert.AreEqual("{\"user\":{\"name\":\"kii\"}}", json.ToString()); Assert.AreEqual("{\"name\":\"kii\"}", json.GetJsonObject("user").ToString()); JsonObject inner = json.GetJsonObject("user"); Assert.AreEqual("kii", inner.GetString("name")); }
public void Test_0016_JSONObjectValue_empty() { JsonObject json = new JsonObject("{\"id\":{}}"); Assert.AreEqual("{\"id\":{}}", json.ToString()); Assert.AreEqual("{}", json.GetJsonObject("id").ToString()); }
public void Test_0036_set_JSONObject_empty() { JsonObject json = new JsonObject(); JsonObject inner = new JsonObject(); json.Put("user", inner); Assert.AreEqual("{\"user\":{}}", json.ToString()); Assert.AreEqual("{}", json.GetJsonObject("user").ToString()); }
public void Test_0037_set_JSONObject_hasValue() { JsonObject json = new JsonObject(); JsonObject inner = new JsonObject(); inner.Put("name", "kii"); json.Put("user", inner); Assert.AreEqual("{\"user\":{\"name\":\"kii\"}}", json.ToString()); Assert.AreEqual("{\"name\":\"kii\"}", json.GetJsonObject("user").ToString()); }