tests: fix

Need to mock paths now
This commit is contained in:
Alexander Capehart 2023-12-20 13:39:49 -07:00
parent c995eb0d04
commit 5562c18415
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -31,6 +31,8 @@ import org.oxycblt.auxio.music.device.ArtistImpl
import org.oxycblt.auxio.music.device.DeviceLibraryImpl
import org.oxycblt.auxio.music.device.GenreImpl
import org.oxycblt.auxio.music.device.SongImpl
import org.oxycblt.auxio.music.fs.Components
import org.oxycblt.auxio.music.fs.Path
class DeviceLibraryTest {
@ -42,12 +44,14 @@ class DeviceLibraryTest {
mockk<SongImpl> {
every { uid } returns songUidA
every { durationMs } returns 0
every { path } returns Path(mockk(), Components.parse("./"))
every { finalize() } returns this
}
val songB =
mockk<SongImpl> {
every { uid } returns songUidB
every { durationMs } returns 1
every { path } returns Path(mockk(), Components.parse("./"))
every { finalize() } returns this
}
val deviceLibrary = DeviceLibraryImpl(listOf(songA, songB), listOf(), listOf(), listOf())
@ -156,11 +160,13 @@ class DeviceLibraryTest {
val songA =
mockk<SongImpl> {
every { uid } returns Music.UID.auxio(MusicType.SONGS)
every { path } returns Path(mockk(), Components.parse("./"))
every { finalize() } returns this
}
val songB =
mockk<SongImpl> {
every { uid } returns Music.UID.auxio(MusicType.SONGS)
every { path } returns Path(mockk(), Components.parse("./"))
every { finalize() } returns this
}
val album =