Skip to content

Commit

Permalink
Fixed test errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
zahlio committed Nov 19, 2014
1 parent e35ff9e commit 7a0b169
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/hotciv/standard/TestAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
TestDeltaCivWorldLayout.class,
TestEpsilonCivAttacking.class,
TestEpsilonCivWinning.class,
TestGammaCiv.class
TestGammaCiv.class
})
public class TestAll {

Expand Down
2 changes: 1 addition & 1 deletion test/hotciv/standard/TestAlphaCiv.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public void shouldProduceX(Unit _u, String _unitConstant, Position p){
p.getRow(),
p.getColumn()
),
GameConstants.ARCHER,
_unitConstant,
_u.getTypeString()
);

Expand Down
11 changes: 8 additions & 3 deletions test/hotciv/standard/TestGammaCiv.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.junit.Assert.assertNull;
import hotciv.common.GameImpl;
import hotciv.framework.Game;
import hotciv.framework.Player;
import hotciv.framework.Position;
import hotciv.framework.Unit;
import hotciv.variants.AlphaCivAging;
Expand All @@ -26,11 +27,15 @@ public void setUp() {
@Test
public void settlerShouldHaveCreatedACityAt4_3(){
game.performUnitActionAt(new Position(4,3));
settlerShouldHaveCreatedACityAt(4, 3);
settlerShouldHaveCreatedACityAt(4, 3, Player.RED);
}

public void settlerShouldHaveCreatedACityAt(int x, int y){
assertNull(String.format("There should be a city at (%d, %d) owned by player Red", x, y), game.getCityAt(new Position(x, y)));
public void settlerShouldHaveCreatedACityAt(int x, int y, Player p){
assertEquals(
String.format("There should be a city at (%d, %d) owned by player %s", x, y, p),
p,
game.getCityAt(new Position(x, y)).getOwner()
);
}

@Test
Expand Down

0 comments on commit 7a0b169

Please sign in to comment.