private void TestProgrammaticallyGeneratedGraph( int numberOfVertices, int numberOfPathsToFind ) { IList <Edge> edgesForBigGraph = CreateEdgesForBigGraph(numberOfVertices); Vertex startVertex = edgesForBigGraph[0].StartVertex; Vertex endVertex = edgesForBigGraph[edgesForBigGraph.Count - 1].EndVertex; IList <PathFinderFactory> pathFinderFactories = PathFinderFactories.CreatePathFinderFactories(); GraphShortestPathAssertionHelper graphShortestPathAssertionHelper = new GraphShortestPathAssertionHelper(isExecutingThroughTheMainMethod); graphShortestPathAssertionHelper.TestResultsWithImplementationsAgainstEachOther(edgesForBigGraph, startVertex, endVertex, numberOfPathsToFind, pathFinderFactories); }
private void VerifyExpectedResults(IList <Edge> edges) { // the parameter GraphEdgesValidationDesired.NO will be used so therefore do the validation once externally here first GraphEdgesValidator <Path, Edge, Vertex, Weight> .ValidateEdgesForGraphCreation <Path, Edge, Vertex, Weight>(edges); ExpectedPath[] expectedPaths = GetExpectedPaths(); IList <PathFinderFactory> pathFinderFactories = PathFinderFactories.CreatePathFinderFactories(); foreach (PathFinderFactory pathFinderFactory in pathFinderFactories) { VerifyExpectedPaths(a, d, edges, pathFinderFactory, expectedPaths); } }
public void SetUp() { pathFinderFactories = PathFinderFactories.CreatePathFinderFactories(); vertexA = CreateVertex("A"); vertexB = CreateVertex("B"); vertexC = CreateVertex("C"); vertexX_notPartOfGraph = CreateVertex("X"); edgeAB = CreateEdge(vertexA, vertexB, CreateWeight(123)); edgeBC = CreateEdge(vertexB, vertexC, CreateWeight(456)); edges_A_B_and_B_C = new List <Edge>(); edges_A_B_and_B_C.Add(edgeAB); edges_A_B_and_B_C.Add(edgeBC); }
public void SetUp() { edgeUtility = EdgeUtility <Edge, Vertex, Weight> .Create <Edge, Vertex, Weight>(); //fileReaderForGraphTestData = FileReaderForGraphEdges<Edge, Vertex, Weight>.CreateFileReaderForGraphEdges(new EdgeFactoryDefault()); graphShortestPathAssertionHelper = new GraphShortestPathAssertionHelper(false); xmlFileReader = new XmlFileReader(); resourceReader = new ResourceReader(); edgeParser = EdgeParser <Edge, Vertex, Weight> .CreateEdgeParserDefault(); pathFinderFactoriesForAllImplementations = PathFinderFactories.CreatePathFinderFactories(); pathFinderFactories = new List <PathFinderFactory>(); // set to empty here before each test, so add to the list if it needs to be used pathsToResourcesFoldersWithXmlTestFiles = new List <string> { DIRECTORY_FOR_XML_TEST_FILES_FROM_BSMOCK, DIRECTORY_FOR_XML_TEST_FILES_FROM_YANQI, BASE_DIRECTORY_FOR_XML_TEST_FILES // yes the base directory itself also currently has some xml test files }; graphShortestPathAssertionHelper.SetConsoleOutputDesired(ConsoleOutputDesired.NONE); }