package solutions.tretter.mindmachine

import solutions.tretter.mindmachine.domain.Presets
import solutions.tretter.mindmachine.domain.VisualPattern
import org.junit.Assert.assertEquals
import org.junit.Test

class PresetDefaultsTest {
    @Test
    fun mvp_has_eight_preset_programs_with_expected_defaults() {
        assertEquals(8, Presets.builtIn.size)
        val deepRelease = Presets.builtIn.first { it.id == "deep_release" }
        val laserFocus = Presets.builtIn.first { it.id == "laser_focus" }
        val creativeDrift = Presets.builtIn.first { it.id == "creative_drift" }
        val resetBreath = Presets.builtIn.first { it.id == "reset_breath" }
        val nightRampdown = Presets.builtIn.first { it.id == "night_rampdown" }
        val powerWarmup = Presets.builtIn.first { it.id == "power_warmup" }
        val bodyScan = Presets.builtIn.first { it.id == "body_scan" }
        val stormToStill = Presets.builtIn.first { it.id == "storm_to_still" }

        assertEquals(18 * 60, deepRelease.defaultDurationSec)
        assertEquals(VisualPattern.PULSE, deepRelease.visualPatternType)
        assertEquals(260, deepRelease.flashIntervalMs)

        assertEquals(16 * 60, laserFocus.defaultDurationSec)
        assertEquals(VisualPattern.FLASH, laserFocus.visualPatternType)
        assertEquals(120, laserFocus.flashIntervalMs)

        assertEquals(22 * 60, creativeDrift.defaultDurationSec)
        assertEquals(VisualPattern.PULSE, creativeDrift.visualPatternType)
        assertEquals(190, creativeDrift.flashIntervalMs)

        assertEquals(12 * 60, resetBreath.defaultDurationSec)
        assertEquals(VisualPattern.PULSE, resetBreath.visualPatternType)
        assertEquals(300, resetBreath.flashIntervalMs)

        assertEquals(28 * 60, nightRampdown.defaultDurationSec)
        assertEquals(VisualPattern.PULSE, nightRampdown.visualPatternType)
        assertEquals(360, nightRampdown.flashIntervalMs)

        assertEquals(9 * 60, powerWarmup.defaultDurationSec)
        assertEquals(VisualPattern.FLASH, powerWarmup.visualPatternType)
        assertEquals(95, powerWarmup.flashIntervalMs)

        assertEquals(20 * 60, bodyScan.defaultDurationSec)
        assertEquals(VisualPattern.PULSE, bodyScan.visualPatternType)
        assertEquals(210, bodyScan.flashIntervalMs)

        assertEquals(24 * 60, stormToStill.defaultDurationSec)
        assertEquals(VisualPattern.FLASH, stormToStill.visualPatternType)
        assertEquals(150, stormToStill.flashIntervalMs)
    }
}
