X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSoneTest.kt;h=42980eeb12a7a242f75a0ec459a625aa73bc0c95;hp=1429e544e20bee2fe7e14175b4931401efe215f6;hb=5473139d890c40c85712f59ba534583961c2772e;hpb=509b81185b3a1e82bb78308640d0d7b6b741d3e0 diff --git a/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt b/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt index 1429e54..42980ee 100644 --- a/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/data/SoneTest.kt @@ -142,4 +142,16 @@ class SoneTest { assertThat(imageCountComparator.compare(sone1, sone2), equalTo(0)) } + @Test + fun `allAlbums returns all albums of a Sone but the root album`() { + 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) + assertThat(sone.allAlbums, contains(album1, album11, album2)) + } + }