示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
 public void TestNull_Total()
 {
     _result = new TreeGridResult(null, false, 0);
     Assert.AreEqual("{\"total\":\"0\",\"rows\":[]}", _result.ToString());
 }
示例#4
0
 public void TestNull()
 {
     _result = new TreeGridResult(null);
     Assert.AreEqual("[]", _result.ToString());
 }