예제 #1
0
        public void ListOfDepths_OneNode_One()
        {
            var tree = CreateOneNode();

            var actual = TreeExtensions.CreateListOfDepths(tree);

            Assert.AreEqual(1, actual.Count);
            Assert.AreEqual(0, actual[0].First.Value.Value);
        }
예제 #2
0
        public void ListOfDepths_TwoLevels_ExpectedResult()
        {
            var tree = CreateTwoLevels();

            var actual = TreeExtensions.CreateListOfDepths(tree);

            Assert.AreEqual(2, actual.Count);
            Assert.AreEqual(0, actual[0].First.Value.Value);
            Assert.AreEqual(1, actual[1].First.Value.Value);
            Assert.AreEqual(2, actual[1].First.Next.Value.Value);
        }
예제 #3
0
        public void ListOfDepths_Null_Null()
        {
            var actual = TreeExtensions.CreateListOfDepths <int>(null);

            Assert.AreEqual(null, actual);
        }