From 0efdd72f50f1d52a711bedd296e18e243da781d5 Mon Sep 17 00:00:00 2001 From: Leon Montag Date: Fri, 30 Dec 2022 17:17:22 +0100 Subject: [PATCH] created Test for SplitAnswer method --- src/test/java/game/runGameTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/game/runGameTest.java b/src/test/java/game/runGameTest.java index 4e63bc7..ce7349e 100644 --- a/src/test/java/game/runGameTest.java +++ b/src/test/java/game/runGameTest.java @@ -58,5 +58,16 @@ class runGameTest { } + @Test + public void testSplitAnswers() { + String[] StringToSplit = {"Das,ist,ein,Test", "1,2,3,4"}; + String[] parts = runGame.SplitAnswers(StringToSplit, 1); + assertEquals(4, parts.length); + assertEquals("1", parts[0]); + assertEquals("2", parts[1]); + assertEquals("3", parts[2]); + assertEquals("4", parts[3]); + } + }