From 3f5b2b7d73eeb267ec6b57ddcdc4054e288413e9 Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Wed, 31 Jan 2024 13:53:00 +0100 Subject: [PATCH] refactoring: TestShuffleDeck Improve Safety --- src/test/java/de/hsfulda/onses/GameServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/hsfulda/onses/GameServiceTest.java b/src/test/java/de/hsfulda/onses/GameServiceTest.java index 9910bea..b22147d 100644 --- a/src/test/java/de/hsfulda/onses/GameServiceTest.java +++ b/src/test/java/de/hsfulda/onses/GameServiceTest.java @@ -88,12 +88,12 @@ public class GameServiceTest { int counter = 0; - for (int i = 0; i < 112; i++) { + for (int i = 0; i < notshuffled.getGame().getDrawCardDeck().size(); 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) { + if (counter == notshuffled.getGame().getDrawCardDeck().size()) { fail("Deck wurde nicht richtig gemischt"); } }