Fix incorrect comparison
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / data / impl / ImageImplTest.kt
1 package net.pterodactylus.sone.data.impl
2
3 import net.pterodactylus.sone.data.Image
4 import org.junit.Test
5
6 /**
7  * Unit test for [ImageImpl].
8  */
9 class ImageImplTest {
10
11     private val image = ImageImpl()
12
13     @Test(expected = Image.Modifier.ImageTitleMustNotBeEmpty::class)
14     fun `modifier does not allow title to be empty`() {
15         image.modify().setTitle("").update()
16     }
17
18     @Test(expected = IllegalStateException::class)
19     fun `album cannot be changed to album of different Sone`() {
20         val sone1 = IdOnlySone("Sone1")
21         val sone2 = IdOnlySone("Sone2")
22         image.modify().setSone(sone1).update()
23         val album = AlbumImpl(sone2)
24         image.album = album
25      }
26
27 }