mirror of https://github.com/usbharu/Hideout.git
test: prevとnextがnullになる場合のテストを追加
This commit is contained in:
parent
f80148815a
commit
2d6d25763e
|
@ -97,6 +97,16 @@ class ExposedPaginationExtensionKtTest {
|
||||||
assertThat(pagination).size().isEqualTo(30)
|
assertThat(pagination).size().isEqualTo(30)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun 結果が0件の場合はprevとnextがnullになる():Unit = transaction {
|
||||||
|
val pagination = ExposePaginationTestTable.select { ExposePaginationTestTable.id.isNull() }
|
||||||
|
.withPagination(Page.of(), ExposePaginationTestTable.id)
|
||||||
|
|
||||||
|
assertThat(pagination).isEmpty()
|
||||||
|
assertThat(pagination.next).isNull()
|
||||||
|
assertThat(pagination.prev).isNull()
|
||||||
|
}
|
||||||
|
|
||||||
object ExposePaginationTestTable : Table(){
|
object ExposePaginationTestTable : Table(){
|
||||||
val id = long("id")
|
val id = long("id")
|
||||||
val name = varchar("name",100)
|
val name = varchar("name",100)
|
||||||
|
|
Loading…
Reference in New Issue