update testLongestRoad
This commit is contained in:
parent
99eab9ad69
commit
3b721301fa
|
@ -185,6 +185,11 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
|
||||||
return longestRoadFaction;
|
return longestRoadFaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo javadoc
|
||||||
|
public int getLongestRoadLenth() {
|
||||||
|
return longestRoadLenth;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is recursive and adds all roads which belongs to a specific players and stringing together to a HashSet.
|
* This method is recursive and adds all roads which belongs to a specific players and stringing together to a HashSet.
|
||||||
* The length of the HashSet represents the length of the longest Road the player has.
|
* The length of the HashSet represents the length of the longest Road the player has.
|
||||||
|
|
|
@ -37,8 +37,6 @@ public class SiedlerGameTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testLongestRoad() {
|
public void testLongestRoad() {
|
||||||
HashMap<Config.Faction,Integer> currentLongestRoad = new HashMap<>();
|
|
||||||
//currentLongestRoad.put(Config.Faction.RED,5);
|
|
||||||
List<Config.Faction> factionList = Arrays.asList(Config.Faction.values());
|
List<Config.Faction> factionList = Arrays.asList(Config.Faction.values());
|
||||||
|
|
||||||
SiedlerBoard board = new SiedlerBoard();
|
SiedlerBoard board = new SiedlerBoard();
|
||||||
|
@ -52,7 +50,7 @@ public class SiedlerGameTest {
|
||||||
board.setEdge(new Point(4, 10), new Point(5, 9), new Road(Config.Faction.BLUE,new Point(4, 10),new Point(5, 9)));
|
board.setEdge(new Point(4, 10), new Point(5, 9), new Road(Config.Faction.BLUE,new Point(4, 10),new Point(5, 9)));
|
||||||
board.setCorner(new Point(3,7),new Settlement(Config.Faction.BLUE,new Point(3,7)));
|
board.setCorner(new Point(3,7),new Settlement(Config.Faction.BLUE,new Point(3,7)));
|
||||||
assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList));
|
assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList));
|
||||||
//assertEquals(6,currentLongestRoad.get(Config.Faction.BLUE));
|
assertEquals(6,board.getLongestRoadLenth());
|
||||||
//todo prüfen ob länge Stimmt.
|
//todo prüfen ob länge Stimmt.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue