public void BKTree_should_FindBestNode() { BKTree <TestNode> tree = new BKTree <TestNode>(); TestNode search = new TestNode(new int[] { 210, 175, 233 }); TestNode best = new TestNode(2, new int[] { 200, 200, 200 }); tree.add(new TestNode(1, new int[] { 100, 100, 100 })); tree.add(best); tree.add(new TestNode(3, new int[] { 300, 300, 300 })); tree.add(new TestNode(4, new int[] { 400, 400, 400 })); tree.add(new TestNode(5, new int[] { 500, 500, 500 })); TestNode found = tree.findBestNode(search); Assert.Equal(2, found.Id); Assert.Equal(best.Data, found.Data); }
public void BKTree_should_FindBestNode() { BKTree<TestNode> tree = new BKTree<TestNode>(); TestNode search = new TestNode(new int[] { 210, 175, 233 }); TestNode best = new TestNode(2, new int[] { 200, 200, 200 }); tree.add(new TestNode(1, new int[] { 100, 100, 100 })); tree.add(best); tree.add(new TestNode(3, new int[] { 300, 300, 300 })); tree.add(new TestNode(4, new int[] { 400, 400, 400 })); tree.add(new TestNode(5, new int[] { 500, 500, 500 })); TestNode found = tree.findBestNode(search); Assert.Equal(2, found.Id); Assert.Equal(best.Data, found.Data); }