Browse Source

Test.Relationship.Player.Game

main
fdai7920 11 months ago
parent
commit
32f5d03720
  1. 15
      src/test/java/de/hsfulda/onses/PlayerTest.java

15
src/test/java/de/hsfulda/onses/PlayerTest.java

@ -1,6 +1,8 @@
package de.hsfulda.onses;
import de.hsfulda.onses.models.Game;
import de.hsfulda.onses.services.PlayerService;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
@ -43,4 +45,17 @@ public class PlayerTest {
assertEquals(testCard1, firstCardPlayerDeck);
assertEquals(testCard2, secondCardPlayerDeck);
}
@Test
@DisplayName("Relationship_Player_Game")
void Relationship_Player_Game() {
// arrange
PlayerService input = new PlayerService();
Game expected = input.getGame();
// act
Game answer1 = input.getPlayerList().getFirst().getPlayerService().getGame();
Game answer2 = input.getPlayerList().getLast().getPlayerService().getGame();
// assert
assertEquals(expected, answer1);
assertEquals(expected, answer2);
}
}
Loading…
Cancel
Save