gruppe06-hufflepuff-projekt.../test/ch/zhaw/catan/SiedlerGameTest.java

54 lines
2.3 KiB
Java
Raw Normal View History

2021-11-19 08:32:32 +01:00
package ch.zhaw.catan;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.beryx.textio.TextIO;
import org.beryx.textio.TextIoFactory;
import org.beryx.textio.TextTerminal;
2021-11-19 08:32:32 +01:00
import org.junit.jupiter.api.Test;
import java.awt.*;
2021-11-19 08:32:32 +01:00
/***
* TODO Write your own tests in this class.
*
* Note: Have a look at {@link ch.zhaw.catan.games.ThreePlayerStandard}. It can be used
* to get several different game states.
*
*/
public class SiedlerGameTest {
@Test
public void dummyTestMethod() {
assertTrue(false);
}
/**
* To Test getLongestRoad in SiedlerGame isolatet do:
* 1. make SiedlerGame.getLongestRoadFaction, Siedlergame.countRoad && Siedlergame.getNextPoint static
* 2. make SiedlerGame.getLongestRoadFaction public
* 3. add Parameter Board to SiedlerGame.getLongestRoadFaction and SiedlerGame.countRoad.
* 4. add Parameter faction to SiedlerGame.getLongestRoadFaction
* 5. Create Board in testLongestRoad() and Hashmap with faction
* Tipp: Logic Equivalent classes are: start counting at settlements with 0 or 1 or 2 or 3 own roads attached to it
* Make branches in between the road with diffrent lengths.
*
*/
@Test
public void testLongestRoad() {
SiedlerBoard board = new SiedlerBoard();
board.createFixGamefield();
board.setEdge(new Point(6, 6), new Point(5, 7), new Road(Config.Faction.BLUE,new Point(6, 6),new Point(5, 7)));
board.setEdge(new Point(4, 6), new Point(5, 7), new Road(Config.Faction.BLUE,new Point(4, 6),new Point(5, 7)));
board.setEdge(new Point(4, 6), new Point(4, 4), new Road(Config.Faction.BLUE,new Point(4, 6),new Point(4, 4)));
board.setEdge(new Point(4, 6), new Point(3, 7), new Road(Config.Faction.BLUE,new Point(4, 6),new Point(3, 7)));
board.setEdge(new Point(3, 7), new Point(3, 9), new Road(Config.Faction.BLUE,new Point(3, 7),new Point(3, 9)));
board.setEdge(new Point(3, 9), new Point(4, 10), new Road(Config.Faction.BLUE,new Point(3, 9),new Point(4, 10)));
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)));
//SiedlerGame.getLongestRoadFaction(board,faction);
}
2021-11-19 08:32:32 +01:00
}