public void GivenTreeAndMinimumDate_ThenDoesNotGoBeyondIt() { TreeWalkerTestData data = new TreeWalkerTestData(); ITreeWalker tw = new TreeWalker(); INode[] allNodes = tw.EnumerateAllParentsBreadthFirst(data.D, data.B).ToArray(); Assert.Equal(new[] { data.B, data.E, data.G, data.C }, allNodes); }
public void GivenRhombus_ThenReturnsAllItemsOnce() { TreeWalkerTestData data = new TreeWalkerTestData(); ITreeWalker tw = new TreeWalker(); INode[] allNodes = tw.EnumerateAllParentsBreadthFirst(data.D, null).ToArray(); Assert.Equal(new[] { data.B, data.E, data.G, data.A, data.C, data.F, data.X }, allNodes); }