X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSoneTest.kt;h=fb2312125a02e22d3459decd97bb81899255d870;hp=42980eeb12a7a242f75a0ec459a625aa73bc0c95;hb=8e2e2aa6f1c7c4e9b4b994caee11677d4cd41403;hpb=e13cd46faa0404418176f8747d52e8160b2a7068 diff --git a/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt b/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt index 42980ee..fb23121 100644 --- a/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt @@ -154,4 +154,19 @@ class SoneTest { assertThat(sone.allAlbums, contains(album1, album11, album2)) } + @Test + fun `allImages returns all images of a Sone`() { + val sone = object : IdOnlySone("1") { + private val rootAlbum = AlbumImpl(this) + override fun getRootAlbum() = rootAlbum + } + val album1 = AlbumImpl(sone).also(sone.rootAlbum::addAlbum) + val album11 = AlbumImpl(sone).also(album1::addAlbum) + val album2 = AlbumImpl(sone).also(sone.rootAlbum::addAlbum) + val image1 = createImage(sone).also(album1::addImage) + val image11 = createImage(sone).also(album11::addImage) + val image2 = createImage(sone).also(album2::addImage) + assertThat(sone.allImages, containsInAnyOrder(image1, image11, image2)) + } + }