@@ -0,0 +1,1738 @@
+package UnitTests;%0A%0Aimport static org.junit.Assert.*;%0Aimport java.util.ArrayList;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport DijkstraAlgorithm.Graph;%0Aimport DijkstraAlgorithm.GraphMaker;%0Aimport DijkstraAlgorithm.Vector2D;%0A%0A/**%0A * @author Dragonheart%0A */%0Apublic class testGraphMaker %7B%0A%09private static boolean%5B%5D%5B%5D map;%0A%0A%09/**%0A%09 * @throws java.lang.Exception%0A%09 */%0A%09@BeforeClass%0A%09public static void setUpBeforeClass() throws Exception %7B%0A%09%09map = new boolean%5B7%5D%5B%5D;%0A%09%09map%5B0%5D = new boolean%5B%5D%7Btrue, true, false, true, true, true, true%7D;%0A%09%09map%5B1%5D = new boolean%5B%5D%7Bfalse, true, false, false, true, false, true%7D;%0A%09%09map%5B2%5D = new boolean%5B%5D%7Btrue, true, true, false, true, false, true%7D;%0A%09%09map%5B3%5D = new boolean%5B%5D%7Btrue, false, true, false, true, false, true%7D;%0A%09%09map%5B4%5D = new boolean%5B%5D%7Btrue, false, true, true, true, false, true%7D;%0A%09%09map%5B5%5D = new boolean%5B%5D%7Btrue, true, true, false, false, true, true%7D;%0A%09%09map%5B6%5D = new boolean%5B%5D%7Bfalse, false, false, false, false, false, true%7D;%0A%09%7D%0A%0A%09/**%0A%09 * Test method for %7B@link DijkstraAlgorithm.GraphMaker#rectangularMap(boolean%5B%5D%5B%5D, int, int)%7D.%0A%09 */%0A%09@Test%0A%09public final void testRectangularMap() %7B%0A%09%09Graph graph = GraphMaker.rectangularMap(map, 1, 1);%0A%09%09ArrayList%3CVector2D%3E nodes = graph.allNodes();%0A%09%09assertEquals(29, nodes.size());%0A%09%09graph.sourceVector(nodes.get(0));%0A%09%09graph.calculateShortestPath();%0A%09%09ArrayList%3CVector2D%3E path = graph.retrieveShortestPath(nodes.get(nodes.size() - 1));%0A%09%09assertEquals(8, path.size());%0A%0A%09%09graph = GraphMaker.rectangularMap(map, 1, -1);%0A%09%09nodes = graph.allNodes();%0A%09%09assertEquals(29, nodes.size());%0A%09%09graph.sourceVector(nodes.get(0));%0A%09%09graph.calculateShortestPath();%0A%09%09path = graph.retrieveShortestPath(nodes.get(nodes.size() - 1));%0A%09%09assertEquals(21, path.size());%0A%09%7D%0A%7D%0A

Test for GraphMaker finished