public void FacadeSimpleListTest() { string json = "[\r\n \"Adam\",\r\n \"Danny\",\r\n \"James\",\r\n \"Justin\"\r\n ]"; IList listForJson = JSONManager.getListForJson(json); Assert.IsTrue(listForJson.Count == 4); Assert.AreEqual((string)listForJson[0], "Adam"); Assert.AreEqual((string)listForJson[1], "Danny"); Assert.AreEqual((string)listForJson[2], "James"); Assert.AreEqual((string)listForJson[3], "Justin"); }
public void FacadeNestedArrayTest() { string json = "\r\n [\r\n [\r\n \"testA1\",\r\n \"testA2\",\r\n \"testA3\"\r\n ],\r\n [\r\n \"testB1\",\r\n \"testB2\",\r\n \"testB3\"\r\n ]\r\n ]"; IList listForJson = JSONManager.getListForJson(json); Assert.IsTrue(listForJson != null && listForJson.Count == 2); IList list = (IList)listForJson[0]; Assert.IsTrue(list != null && list.Count == 3); Assert.AreEqual(list[0], "testA1"); Assert.AreEqual(list[1], "testA2"); Assert.AreEqual(list[2], "testA3"); IList list2 = (IList)listForJson[1]; Assert.IsTrue(list != null && list2.Count == 3); Assert.AreEqual(list2[0], "testB1"); Assert.AreEqual(list2[1], "testB2"); Assert.AreEqual(list2[2], "testB3"); }