Skip to content

Commit 4879e8e

Browse files
committed
Fix BinaryTreeRecursiveWalkerTests
1 parent 5bdecfd commit 4879e8e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

UnitTest/AlgorithmsTests/BinaryTreeRecursiveWalkerTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
using DataStructures.Trees;
33
using System;
44
using System.Collections.Generic;
5+
using System.Linq;
56
using Xunit;
67

78
namespace UnitTest.AlgorithmsTests
89
{
9-
public class BinaryTreeRecursiveWalkerTests
10+
public static class BinaryTreeRecursiveWalkerTests
1011
{
11-
// Construct a Simple Binary Search Tree
12+
// Construct a Simple Binary Search Tree
1213
private static readonly BSTNode<int> Root = new BSTNode<int>(10)
1314
{
1415
LeftChild = new BSTNode<int>(5)
@@ -85,7 +86,7 @@ private static void TestPostOrderTraversal()
8586

8687
// Assert the fact that adding items POST-ORDER will result in [3, 7, 5, 13, 17, 15, 10]
8788
BinaryTreeRecursiveWalker.ForEach(Root, addToList, postOrder);
88-
Assert.True(list.ToArray() == new[] { 3, 7, 5, 13, 17, 15, 10 },
89+
Assert.True(list.SequenceEqual(new[] { 3, 7, 5, 13, 17, 15, 10 }),
8990
"Wrong traversal, expected InOrder enumeration of tree!");
9091
}
9192

0 commit comments

Comments
 (0)