From 739a500c4200fc49de959e7084f89327aec2326f Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Mon, 16 Jan 2023 23:52:39 +0100 Subject: [PATCH] created test for checking if correct action is performed after wrong Answer is pressed --- src/test/java/game/loadNextQuestionTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/game/loadNextQuestionTest.java b/src/test/java/game/loadNextQuestionTest.java index 33d613c..f23ecb6 100644 --- a/src/test/java/game/loadNextQuestionTest.java +++ b/src/test/java/game/loadNextQuestionTest.java @@ -33,5 +33,18 @@ class loadNextQuestionTest { assertEquals(1, gameGui.questionNr); } + + @Test + public void testWrongAnswer() { + //arrange + gameGui.questionNr = 0; + loadNextQuestion loadNextQuestion = new loadNextQuestion(); + runGame.splitAns = new String[] {"option1", "option2", "option3", "option4", "3"}; + //act + gameGui.AnswersBtn1.doClick(); + //assert + assertEquals(0, gameGui.questionNr); + + } } \ No newline at end of file