Browse Source

unittest: Edited test for QuizCommand

This test tests whether the canPlayAgain function works or not
remotes/origin/quiz
Friederike von Gruben 2 years ago
parent
commit
e6b712ca09
  1. 8
      src/test/java/org/bitbiome/commands/QuizCommandTest.java

8
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);
}
}
Loading…
Cancel
Save