Fix incorrect comparison
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / data / impl / ImageImplTest.kt
index 022bde0..e1551e1 100644 (file)
@@ -15,4 +15,13 @@ class ImageImplTest {
         image.modify().setTitle("").update()
     }
 
+    @Test(expected = IllegalStateException::class)
+    fun `album cannot be changed to album of different Sone`() {
+        val sone1 = IdOnlySone("Sone1")
+        val sone2 = IdOnlySone("Sone2")
+        image.modify().setSone(sone1).update()
+        val album = AlbumImpl(sone2)
+        image.album = album
+     }
+
 }