public void TestGetResult_5() { var list = new List <TreeDto> { GetNode1(), GetNode2(), GetNode3(), GetNode4(), GetNode5() }; var result = new TreeTableResult <TreeDto>(list).GetResult(); Assert.Equal(2, result.Count); var root = result[0]; Assert.Equal(Id, root.Id); Assert.Equal(4, root.Children.Count); Assert.Equal(Id, root.Children[0].Id); Assert.False(root.Children[0].Leaf); Assert.Equal(Id4, root.Children[1].Id); Assert.False(root.Children[1].Leaf); Assert.Equal(Id5, root.Children[2].Id); Assert.True(root.Children[2].Leaf); Assert.Equal(Id2, root.Children[3].Id); Assert.True(root.Children[3].Leaf); Assert.Equal(Id3, result[1].Id); Assert.Single(result[1].Children); Assert.Equal(Id3, result[1].Children[0].Id); Assert.True(result[1].Children[0].Leaf); }
public void TestGetResult_1() { var list = new List <TreeDto> { GetNode1() }; var result = new TreeTableResult <TreeDto>(list).GetResult(); Assert.Single(result); var root = result[0]; Assert.Equal(Id, root.Id); Assert.Single(root.Children); Assert.Equal(Id, root.Children[0].Id); Assert.True(root.Children[0].Leaf); }