public void ChainTest() { int n = 10; int m = n - 1; int start = 0, end = n - 1; GraphContext graphContext = new GraphContext(CreateChain(n)); Assert.AreEqual(graphContext.Distance(start, end), m); Assert.AreEqual(graphContext.Distance(n - 1, start), m); }
public void FullGraphTest() { int n = 10; GraphContext graphContext = new GraphContext(CreateFullGraph(n)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) { Assert.AreEqual(graphContext.Distance(i, j), 0); } else { Assert.AreEqual(graphContext.Distance(i, j), 1); } } } }