From 32f5d0372075730412156463a635018b3746bbbd Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Fri, 2 Feb 2024 15:18:31 +0100 Subject: [PATCH] Test.Relationship.Player.Game --- src/test/java/de/hsfulda/onses/PlayerTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/PlayerTest.java b/src/test/java/de/hsfulda/onses/PlayerTest.java index 80c68d5..fcdeeac 100644 --- a/src/test/java/de/hsfulda/onses/PlayerTest.java +++ b/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); + } }