public void TestAync_TreeResult() { var node = new TreeNode { Id = "1", Text = "a" }; _result = new TreeGridResult(new[] { node }, true); Assert.AreEqual("[{\"id\":\"1\",\"text\":\"a\",\"state\":\"closed\"}]", _result.ToString()); }
public void TestAync_DataGridResult() { var node = new TreeNode { Id = "1", Text = "a" }; _result = new TreeGridResult(new[] { node }, true, 1); var expected = new Str(); expected.Add("{\"total\":1,\"rows\":["); expected.Add("{\"id\":\"1\",\"text\":\"a\",\"state\":\"closed\"}"); expected.Add("]}"); Assert.AreEqual(expected.ToString(), _result.ToString()); }
public void TestNull_Total() { _result = new TreeGridResult(null, false, 0); Assert.AreEqual("{\"total\":\"0\",\"rows\":[]}", _result.ToString()); }
public void TestNull() { _result = new TreeGridResult(null); Assert.AreEqual("[]", _result.ToString()); }