protected void BestMatchesFullMatch(DrillDownTree <string, int> tree, ImmutableList <string> keyList, int expectedValue) { ImmutableList <int> matches; int depth = tree.GetBestMatches(keyList, out matches); // make sure depth is the same as the key length Assert.Equal(keyList.Count, depth); Assert.Equal(1, matches.Count); Assert.Equal(expectedValue, matches[0]); }
protected void BestMatchesPartial(DrillDownTree <string, int> tree, ImmutableList <string> keyList, int expectedDepth, params int[] expectedValues) { ImmutableList <int> matches; int depth = tree.GetBestMatches(keyList, out matches); // make sure depth is the same as the key length Assert.Equal(expectedDepth, depth); Assert.Equal(expectedValues.Length, matches.Count); foreach (int expectedValue in expectedValues) { Assert.Contains(expectedValue, matches); } }