From 22ca40565c5bb106270fec8ef3a0d1b869159a02 Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Wed, 31 Jan 2024 13:34:27 +0100 Subject: [PATCH] Test.ShuffleDeck --- .../java/de/hsfulda/onses/GameServiceTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index ec2d8a6..a95ac91 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -75,4 +75,22 @@ public class GameServiceTest { assertEquals(expected, answer); } + + @Test + @DisplayName("ShuffelDeck") + public void ShuffelDeck() { + GameService shuffled = new GameService(); + GameService notshuffled = new GameService(); + + shuffled.fillDrawDeck(); + notshuffled.fillDrawDeck(); + shuffled.shuffleDeck(); + + for (int i = 0; i < 10; i++) { + if (shuffled.getGame().getDrawCardDeck().get(i).getValue() == notshuffled.getGame().getDrawCardDeck().get(i).getValue() && + shuffled.getGame().getDrawCardDeck().get(i).getColor() == notshuffled.getGame().getDrawCardDeck().get(i).getColor()) { + fail("Deck wurde nicht richtig gemischt"); + } + } + } }