Cotton code
26 lines · 928 B · KotlinRaw
package com.cottondb.musicimport com.cottondb.music.player.SongKeeperimport kotlinx.serialization.json.Jsonimport kotlinx.serialization.json.JsonObjectimport org.junit.Assert.assertEqualsimport org.junit.Test/** Keep on phone and Remove download act on the keys the core's plan names (`songs.keepPlan`), on invented keys. */class SongKeeperTest {    private fun plan(json: String) = Json.parseToJsonElement(json) as JsonObject    @Test    fun the_plan_names_its_songs_by_their_media_keys() {        assertEquals(            listOf("db/music/aa.wav", "db/music/bb.flac"),            SongKeeper.keysOf(plan("""{"keys":["db/music/aa.wav","db/music/bb.flac"]}""")),        )    }    @Test    fun a_plan_with_nothing_to_do_names_no_song() {        assertEquals(emptyList<String>(), SongKeeper.keysOf(plan("""{"keys":[]}""")))        assertEquals(emptyList<String>(), SongKeeper.keysOf(plan("""{}""")))    }}