Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Schinc committed May 24, 2024
1 parent 3512161 commit 46fab26
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
8 changes: 0 additions & 8 deletions ChickenAttackerInitialMessageBoardTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,4 @@ void testScoredForestReturnsZero() {
assertEquals(0, board.withClosedForestWithMenhir(PlayerColor.RED, forestArea).messages().getFirst().points());
}

@Test
void testAnimalsIncludeTiger() {
TextMaker textMaker = new TextMakerTestImplementation();
MessageBoard messageBoard = new MessageBoard(textMaker, List.of());
Area<Zone.Meadow> meadowArea = new Area<>(Set.of(new Zone.Meadow(0, List.of(new Animal(10, Animal.Kind.TIGER), new Animal(10, Animal.Kind.AUROCHS)), null)), List.of(), 10);
assertTrue(messageBoard.withScoredHuntingTrap(PlayerColor.RED, meadowArea, Set.of()).messages().getFirst().text().contains("TIGER"));
}

}
30 changes: 0 additions & 30 deletions ChickenAttackerMessageBoardTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,6 @@ void messageBoardWithScoredMeadowWorksWithWorthyButCancelledAnimals() {
assertEquals(List.of(), mb.messages());
}

@Test
void messageBoardWithScoredMeadowWorksWithWorthyAnimals() {
var a1 = new Animal(10_1, Animal.Kind.MAMMOTH);
var a2 = new Animal(20_1, Animal.Kind.AUROCHS);
var a3 = new Animal(20_2, Animal.Kind.TIGER);
var m1 = new Meadow(10, List.of(a1), null);
var m2 = new Meadow(20, List.of(a2, a3), null);
var m3 = new Meadow(30, List.of(), null);
var meadowArea = new Area<>(Set.of(m1, m2, m3), List.of(RED, BLUE), 3);
var mb = new MessageBoard(new BasicTextMaker(), List.of());
mb = mb.withScoredMeadow(meadowArea, Set.of());
var expectedMessage = new MessageBoard.Message("{RED,BLUE}|5|1×MAMMOTH/1×AUROCHS/0×DEER/1×TIGER", 5, Set.of(RED, BLUE), Set.of(1, 2, 3));
assertEquals(List.of(expectedMessage), mb.messages());
}

@Test
void messageBoardWithScoredRiverSystemWorksWithUnoccupiedRiverSystem() {
var l1 = new Lake(18, 1, null);
Expand Down Expand Up @@ -339,21 +324,6 @@ void messageBoardWithScoredPitTrapWorksWithWorthyButCancelledAnimals() {
assertEquals(List.of(), mb.messages());
}

@Test
void messageBoardWithScoredPitTrapWorksWithWorthyAnimals() {
var a1 = new Animal(10_1, Animal.Kind.MAMMOTH);
var a2 = new Animal(20_1, Animal.Kind.AUROCHS);
var a3 = new Animal(20_2, Animal.Kind.TIGER);
var m1 = new Meadow(10, List.of(a1), null);
var m2 = new Meadow(20, List.of(a2, a3), null);
var m3 = new Meadow(30, List.of(), null);
var meadowArea = new Area<>(Set.of(m1, m2, m3), List.of(RED, BLUE), 3);
var mb = new MessageBoard(new BasicTextMaker(), List.of());
mb = mb.withScoredPitTrap(meadowArea, Set.of());
var expectedMessage = new MessageBoard.Message("{RED,BLUE}|5|1×MAMMOTH/1×AUROCHS/0×DEER/1×TIGER", 5, Set.of(RED, BLUE), Set.of(1, 2, 3));
assertEquals(List.of(expectedMessage), mb.messages());
}

@Test
void messageBoardWithScoredRaftWorksWithUnoccupiedRiverSystem() {
var l1 = new Lake(18, 1, null);
Expand Down

0 comments on commit 46fab26

Please sign in to comment.