From 2c8cc9cf41be5b683c311036987e313af8380ede Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Wed, 31 Jan 2024 13:45:29 +0100 Subject: [PATCH] refactoring: Improve TestShuffleDeck --- src/test/java/de/hsfulda/onses/GameServiceTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index a95ac91..9910bea 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -86,9 +86,14 @@ public class GameServiceTest { notshuffled.fillDrawDeck(); shuffled.shuffleDeck(); - for (int i = 0; i < 10; i++) { + int counter = 0; + + for (int i = 0; i < 112; 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()) { + counter ++; + } + if (counter == 112) { fail("Deck wurde nicht richtig gemischt"); } }