X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FAlbumsTest.kt;fp=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FAlbumsTest.kt;h=0000000000000000000000000000000000000000;hp=26af4e99829531322c47956eb0e735d17eba564a;hb=5c5bee980f9cab5792e34d1c9840f73b8b191830;hpb=faf66247a34f64946990a985d2ea3003465969cb diff --git a/src/test/kotlin/net/pterodactylus/sone/data/AlbumsTest.kt b/src/test/kotlin/net/pterodactylus/sone/data/AlbumsTest.kt deleted file mode 100644 index 26af4e9..0000000 --- a/src/test/kotlin/net/pterodactylus/sone/data/AlbumsTest.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Sone - AlbumsTest.kt - Copyright © 2019–2020 David ‘Bombe’ Roden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.pterodactylus.sone.data - -import net.pterodactylus.sone.data.impl.* -import org.hamcrest.MatcherAssert.* -import org.hamcrest.Matchers.* -import kotlin.test.* - -/** - * Unit test for various helper method in `Albums.kt`. - */ -class AlbumsTest { - - @Test - fun `recursive list of all images for album is returned correctly`() { - val sone = IdOnlySone("sone") - val album = AlbumImpl(sone) - val firstNestedAlbum = AlbumImpl(sone) - val secondNestedAlbum = AlbumImpl(sone) - firstNestedAlbum.addImage(createImage(sone, "image-1")) - firstNestedAlbum.addImage(createImage(sone, "image-2")) - secondNestedAlbum.addImage(createImage(sone, "image-3")) - album.addImage(createImage(sone, "image-4")) - album.addAlbum(firstNestedAlbum) - album.addAlbum(secondNestedAlbum) - val images = album.allImages - assertThat(images.map(Image::id), containsInAnyOrder("image-1", "image-2", "image-3", "image-4")) - } - - private fun createImage(sone: IdOnlySone, id: String) = ImageImpl(id).modify().setSone(sone).update() - -}