public void TestFillEquivalency() { // test with just 3 streams _queryGraph.AddStrictEquals(0, "p00", Make(0, "p00"), 1, "p10", Make(1, "p10")); _queryGraph.AddStrictEquals(1, "p10", Make(1, "p10"), 2, "p20", Make(2, "p20")); Assert.IsFalse(_queryGraph.IsNavigableAtAll(0, 2)); Assert.AreEqual(0, QueryGraphTestUtil.GetStrictKeyProperties(_queryGraph, 0, 2).Count); Assert.AreEqual(0, QueryGraphTestUtil.GetIndexProperties(_queryGraph, 0, 2).Count); QueryGraph.FillEquivalentNav(_types, _queryGraph); Assert.IsTrue(_queryGraph.IsNavigableAtAll(0, 2)); String[] expectedOne = new String[] { "p00" }; String[] expectedTwo = new String[] { "p20" }; Assert.IsTrue(Collections.AreEqual(expectedOne, QueryGraphTestUtil.GetStrictKeyProperties(_queryGraph, 0, 2))); Assert.IsTrue(Collections.AreEqual(expectedTwo, QueryGraphTestUtil.GetIndexProperties(_queryGraph, 0, 2))); // test with 5 streams, connect all streams to all streams _queryGraph = new QueryGraph(5, null, false); _queryGraph.AddStrictEquals(0, "p0", Make(0, "p0"), 1, "p1", Make(1, "p1")); _queryGraph.AddStrictEquals(3, "p3", Make(3, "p3"), 4, "p4", Make(4, "p4")); _queryGraph.AddStrictEquals(2, "p2", Make(2, "p2"), 3, "p3", Make(3, "p3")); _queryGraph.AddStrictEquals(1, "p1", Make(1, "p1"), 2, "p2", Make(2, "p2")); QueryGraph.FillEquivalentNav(_types, _queryGraph); for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { if (i == j) { continue; } Assert.IsTrue(_queryGraph.IsNavigableAtAll(i, j), "Not navigable: i=" + i + " j=" + j); } } }