X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetTimesAjaxPageTest.java;fp=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetTimesAjaxPageTest.java;h=0000000000000000000000000000000000000000;hb=4cc2c76f924e2faa17b2b69eb30add5b88abf28a;hp=e1ab857e444b4fb2a51d5052abb7d074d0c761f0;hpb=1a2e2a402b62923a68b09eea463ca3952c5505b0;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPageTest.java b/src/test/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPageTest.java deleted file mode 100644 index e1ab857..0000000 --- a/src/test/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPageTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.pterodactylus.sone.web.ajax; - -import static java.lang.System.currentTimeMillis; -import static net.pterodactylus.sone.web.ajax.GetTimesAjaxPage.getTime; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.mockito.Mockito.RETURNS_DEEP_STUBS; -import static org.mockito.Mockito.when; - -import net.pterodactylus.sone.web.WebInterface; -import net.pterodactylus.sone.web.ajax.GetTimesAjaxPage.Time; - -import org.junit.Test; -import org.mockito.Mockito; - -/** - * Unit test for {@link GetTimesAjaxPage}. - * - * @author David ‘Bombe’ Roden - */ -public class GetTimesAjaxPageTest { - - private final WebInterface webInterface = Mockito.mock(WebInterface.class, RETURNS_DEEP_STUBS); - - @Test - public void timestampInTheFutureIsTranslatedCorrectly() { - when(webInterface.getL10n().getString("View.Time.InTheFuture")).thenReturn("in the future"); - Time time = getTime(webInterface, currentTimeMillis() + 100); - assertThat(time.getText(), is("in the future")); - } - - @Test - public void timestampAFewSecondsAgoIsTranslatedCorrectly() { - when(webInterface.getL10n().getString("View.Time.AFewSecondsAgo")).thenReturn("a few seconds ago"); - Time time = getTime(webInterface, currentTimeMillis() - 1000); - assertThat(time.getText(), is("a few seconds ago")); - } - -}