projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix test so it runs on Windows, too
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
pages
/
KnownSonesPageTest.kt
diff --git
a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt
b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt
index
37e0e95
..
23987b6
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt
@@
-1,6
+1,7
@@
package net.pterodactylus.sone.web.pages
import net.pterodactylus.sone.data.*
package net.pterodactylus.sone.web.pages
import net.pterodactylus.sone.data.*
+import net.pterodactylus.sone.data.impl.*
import net.pterodactylus.sone.freenet.wot.*
import net.pterodactylus.sone.test.*
import net.pterodactylus.sone.utils.*
import net.pterodactylus.sone.freenet.wot.*
import net.pterodactylus.sone.test.*
import net.pterodactylus.sone.utils.*
@@
-37,11
+38,12
@@
class KnownSonesPageTest : WebPageTest(::KnownSonesPage) {
whenever(this.time).thenReturn(time)
whenever(this.posts).thenReturn((0..(posts - 1)).map { mock<Post>() })
whenever(this.replies).thenReturn((0..(replies - 1)).map { mock<PostReply>() }.toSet())
whenever(this.time).thenReturn(time)
whenever(this.posts).thenReturn((0..(posts - 1)).map { mock<Post>() })
whenever(this.replies).thenReturn((0..(replies - 1)).map { mock<PostReply>() }.toSet())
- val album =
mock<Album>(
)
- whenever(album.images).thenReturn(((0..(images - 1)).map { mock<Image>() }))
- val rootAlbum = mock<Album>().apply {
-
whenever(albums).thenReturn(listOf(album)
)
+ val album =
AlbumImpl(this
)
+ repeat(images) {
+ ImageImpl().modify().setSone(this).update()
+
.also(album::addImage
)
}
}
+ val rootAlbum = AlbumImpl(this).also { it.addAlbum(album) }
whenever(this.rootAlbum).thenReturn(rootAlbum)
whenever(this.profile).thenReturn(mock())
whenever(id).thenReturn(name.toLowerCase())
whenever(this.rootAlbum).thenReturn(rootAlbum)
whenever(this.profile).thenReturn(mock())
whenever(id).thenReturn(name.toLowerCase())
@@
-73,7
+75,7
@@
class KnownSonesPageTest : WebPageTest(::KnownSonesPage) {
@Test
fun `page returns correct title`() {
@Test
fun `page returns correct title`() {
-
whenever(l10n.getString("Page.KnownSones.Title")).thenReturn(
"known sones page title")
+
addTranslation("Page.KnownSones.Title",
"known sones page title")
assertThat(page.getPageTitle(soneRequest), equalTo("known sones page title"))
}
assertThat(page.getPageTitle(soneRequest), equalTo("known sones page title"))
}