private void BAModelTest(BAContainer container) { AbstarctGraphAnalyzer analyzer = new BAAnalyzer(container); //test tDegreeDistribution testDegreeDistribution(0, analyzer); //test AveragePath testAveragePath(1, analyzer); //test ClusteringCoefficient testClusteringCoefficient(2, analyzer); //test EigenValue testEigenValue(3, analyzer); //test Cycles of order 3 testCycles3(4, analyzer); // test diameter testDiameter(5, analyzer); // test cycle of order 4 testCycles4(6, analyzer); // test distance between vertexes testDistanceBetweenVertices(7, analyzer); // test distance between eigen values testDistancesBetweenEigenValues(8, analyzer); // test order of max full subgraph testFullSubgraphs(9, analyzer); }
public void BACycles3Test() { XMLResultStorage resultStorage = new XMLResultStorage(""); ResultAssembly goldResult = resultStorage.LoadXML("BAOutput.xml"); BAContainer container = new BAContainer(); container.SetMatrix("BAInput.txt"); AbstarctGraphAnalyzer analyzer = new BAAnalyzer(container); long actualValue = analyzer.GetCycles3(); double expectedValue = goldResult.Results[0].Result[AnalyseOptions.Cycles3]; Assert.AreEqual(actualValue, expectedValue); }
public void BAClusteringCoefficientTest() { XMLResultStorage resultStorage = new XMLResultStorage(""); ResultAssembly goldResult = resultStorage.LoadXML("BAOutput.xml"); BAContainer container = new BAContainer(); container.SetMatrix("BAInput.txt"); AbstarctGraphAnalyzer analyzer = new BAAnalyzer(container); SortedDictionary<double, int> actualValue = analyzer.GetClusteringCoefficient(); SortedDictionary<double, int> expectedValue = goldResult.Results[0].Coefficient; Assert.IsTrue(compare(actualValue, expectedValue)); }
public void BACyclesTest() { XMLResultStorage resultStorage = new XMLResultStorage(""); ResultAssembly goldResult = resultStorage.LoadXML("BAOutput.xml"); BAContainer container = new BAContainer(); container.SetMatrix("BAInput.txt"); AbstarctGraphAnalyzer analyzer = new BAAnalyzer(container); SortedDictionary<int, long> actualValue = analyzer.GetCycles(4, 6); SortedDictionary<int, long> expectedValue = goldResult.Results[0].Cycles; Assert.IsTrue(compare(actualValue, expectedValue)); }
public void BAMinPathDistTest() { XMLResultStorage resultStorage = new XMLResultStorage(""); ResultAssembly goldResult = resultStorage.LoadXML("BAOutput.xml"); BAContainer container = new BAContainer(); container.SetMatrix("BAInput.txt"); AbstarctGraphAnalyzer analyzer = new BAAnalyzer(container); SortedDictionary<int, int> actualValue = analyzer.GetMinPathDist(); SortedDictionary<int, int> expectedValue = goldResult.Results[0].DistanceBetweenVertices; Assert.IsTrue(compare(actualValue, expectedValue)); }
public void BAEigenValueTest() { XMLResultStorage resultStorage = new XMLResultStorage(""); ResultAssembly goldResult = resultStorage.LoadXML("BAOutput.xml"); BAContainer container = new BAContainer(); container.SetMatrix("BAInput.txt"); AbstarctGraphAnalyzer analyzer = new BAAnalyzer(container); ArrayList actualValue = analyzer.GetEigenValues(); ArrayList expectedValue = goldResult.Results[0].EigenVector; Assert.IsTrue(compare(actualValue, expectedValue)); }