X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FReplyTest.kt;h=d7f7138fb0d1aa455b4ba0641c993489c4183312;hp=3289b7d9c690c1a18732a276c2f067d54b1b97c8;hb=0ace0221fc20ef93457b8c62c6ac12286c1aa12c;hpb=f049280a40ddf05f02400e7f0d93a24dea4545c2 diff --git a/src/test/kotlin/net/pterodactylus/sone/data/ReplyTest.kt b/src/test/kotlin/net/pterodactylus/sone/data/ReplyTest.kt index 3289b7d..d7f7138 100644 --- a/src/test/kotlin/net/pterodactylus/sone/data/ReplyTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/data/ReplyTest.kt @@ -22,6 +22,7 @@ import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.greaterThan import org.hamcrest.Matchers.lessThan +import java.util.concurrent.TimeUnit.DAYS import kotlin.test.Test class ReplyTest { @@ -47,4 +48,16 @@ class ReplyTest { assertThat(newestReplyFirst.compare(reply1, reply2), equalTo(0)) } + @Test + fun `noFutureReply filter recognizes reply from the future`() { + val futureReply = emptyPostReply(time = System.currentTimeMillis() + DAYS.toMillis(1)) + assertThat(noFutureReply(futureReply), equalTo(false)) + } + + @Test + fun `noFutureReply filter recognizes reply from the present`() { + val futureReply = emptyPostReply(time = System.currentTimeMillis()) + assertThat(noFutureReply(futureReply), equalTo(true)) + } + }