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(); }
public void GetKeysPreOrder_NonEmptyTree_ReturnsCorrectAnswer() { var tree = new AATree <int>(); tree.AddRange(new [] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }); var expected = new [] { 4, 2, 1, 3, 6, 5, 8, 7, 9, 10 }; var actual = tree.GetKeysPreOrder(); Assert.IsTrue(Enumerable.SequenceEqual(expected, actual)); }
public void GetKeysPreOrder_EmptyTree_ReturnsCorrectAnswer() { var tree = new AATree <int>(); tree.GetKeysPreOrder().ToList().Count.Should().Be(0); }
public void GetKeysPreOrder_EmptyTree_ReturnsCorrectAnswer() { var tree = new AATree <int>(); Assert.IsTrue(tree.GetKeysPreOrder().ToList().Count == 0); }