From e6b712ca09847b466cf91eafa2fad129ec63de54 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 13:39:14 +0100 Subject: [PATCH] unittest: Edited test for QuizCommand This test tests whether the canPlayAgain function works or not --- src/test/java/org/bitbiome/commands/QuizCommandTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/bitbiome/commands/QuizCommandTest.java b/src/test/java/org/bitbiome/commands/QuizCommandTest.java index 1668be2..93afc23 100644 --- a/src/test/java/org/bitbiome/commands/QuizCommandTest.java +++ b/src/test/java/org/bitbiome/commands/QuizCommandTest.java @@ -2,7 +2,7 @@ package org.bitbiome.commands; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class QuizCommandTest { @@ -15,4 +15,10 @@ public class QuizCommandTest { public void testEndMessage() { assertEquals("Das Quiz ist vorbei!", QuizCommand.endMessage()); } + + @Test + public void testLastTimePlayed() { + long lastTimePlayed = System.currentTimeMillis(); + assertTrue(QuizCommand.canPlayAgain(lastTimePlayed) < lastTimePlayed); + } }