package com.cottondb.music import android.app.Application import androidx.compose.ui.test.junit4.createComposeRule import com.cottondb.music.faces.MusicMaterial import com.cottondb.music.faces.TurntableFace import com.cottondb.specimen.SPECIMEN_SCREEN import com.cottondb.specimen.card import com.cottondb.specimen.specimen import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config import org.robolectric.annotation.GraphicsMode /** The turntable (SongTurntableFace.swift) and the party (SongPartyFace.swift) as Music's APK carries them, the clock held still. */ @RunWith(RobolectricTestRunner::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) @Config(sdk = [35], qualifiers = SPECIMEN_SCREEN, application = Application::class) class TurntableSpecimenTest { @get:Rule val compose = createComposeRule() private val s = PlayerSpecimens private fun shot(name: String, json: String, cover: Boolean, playing: Boolean, elapsed: Double, duration: Double) { compose.mainClock.autoAdvance = false compose.specimen("music", name, 360, 470, MusicMaterial.tolex) { TurntableFace(card(json), s.lines, if (cover) s.cover() else null, s.play(playing, elapsed, duration)) } } /** RULE: playing 2:14 into 4:02, the cover round on the label, the arm in the groove, the jewel lit, the sleeve leaning upper left. */ @Test fun turntablePlaying() = shot("turntable-playing", s.harbour("song.turntable"), true, true, 134.0, 242.0) /** RULE: paused, the arm lifted and its shadow thrown further, the jewel dark, the record at rest upright. */ @Test fun turntablePaused() = shot("turntable-paused", s.harbour("song.turntable"), true, false, 134.0, 242.0) /** RULE: with no cover the blank cream label is typed, and the sleeve's typeset blank leans upper left. */ @Test fun turntableNoCover() = shot("turntable-no-cover", s.train("song.turntable"), false, true, 61.0, 197.0) /** RULE: the longest words take two lines and shrink inside the label. */ @Test fun turntableLargest() = shot("turntable-largest", s.largest("song.turntable"), false, false, 312.0, 669.0) /** RULE: the party lays its black label typed red and cream, the reflection and the cover lying flat upper left, on its floor. */ @Test fun partyPlaying() = shot("party-playing", s.harbour("song.party"), true, true, 134.0, 242.0) /** RULE: the party paused: the arm lifted, the jewel dark. */ @Test fun partyPaused() = shot("party-paused", s.harbour("song.party"), true, false, 134.0, 242.0) /** RULE: the party with no cover lays nothing upper left; the longest words stay inside the rings. */ @Test fun partyLargest() = shot("party-largest", s.largest("song.party"), false, false, 312.0, 669.0) }