Exemple #1
0
        public void GetKeysPreOrder_NonEmptyTree_ReturnsCorrectAnswer()
        {
            var tree = new AaTree <int>();

            tree.AddRange(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
            tree.GetKeysPreOrder().SequenceEqual(new[] { 4, 2, 1, 3, 6, 5, 8, 7, 9, 10 })
            .Should().BeTrue();
        }
Exemple #2
0
        public void GetKeysPreOrder_EmptyTree_ReturnsCorrectAnswer()
        {
            var tree = new AaTree <int>();

            tree.GetKeysPreOrder().ToList().Count.Should().Be(0);
        }