Auto commit Sun Mar 22 01:01:14 AM CDT 2026
This commit is contained in:
@@ -21,26 +21,16 @@ class SessionValidatorTest {
|
||||
)
|
||||
|
||||
@Test
|
||||
fun valid_with_headset_passes() {
|
||||
assertNull(SessionValidator.validate(valid, headsetAvailable = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun audio_without_headset_is_blocked() {
|
||||
val error = SessionValidator.validate(valid, headsetAvailable = false)
|
||||
assertEquals("Stereo headphones are required for binaural audio. Connect headphones or switch to Visual-only.", error)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun visual_only_without_headset_passes() {
|
||||
assertNull(SessionValidator.validate(valid.copy(mode = SessionMode.VISUAL_ONLY), headsetAvailable = false))
|
||||
fun valid_config_passes() {
|
||||
assertNull(SessionValidator.validate(valid))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun out_of_range_values_are_blocked() {
|
||||
assertEquals("Duration must be 1 minute to 8 hours.", SessionValidator.validate(valid.copy(durationSec = 59), true))
|
||||
assertEquals("Flash interval must be 0.05 to 2.00 seconds.", SessionValidator.validate(valid.copy(flashIntervalMs = 49), true))
|
||||
assertEquals("Carrier frequency must be between 80 and 400.", SessionValidator.validate(valid.copy(carrierFrequencyHz = 79f), true))
|
||||
assertEquals("Binaural difference must be between 0.5 and 20.", SessionValidator.validate(valid.copy(binauralDifferenceHz = 0.1f), true))
|
||||
assertEquals("Duration must be 1 minute to 8 hours.", SessionValidator.validate(valid.copy(durationSec = 59)))
|
||||
assertEquals("Flash interval must be 0.05 to 2.00 seconds.", SessionValidator.validate(valid.copy(flashIntervalMs = 49)))
|
||||
assertEquals("Carrier frequency must be between 200 and 1200 Hz.", SessionValidator.validate(valid.copy(carrierFrequencyHz = 0f)))
|
||||
assertEquals("Carrier frequency must be between 200 and 1200 Hz.", SessionValidator.validate(valid.copy(carrierFrequencyHz = 20001f)))
|
||||
assertEquals("Binaural difference must be between 0.5 and 20.", SessionValidator.validate(valid.copy(binauralDifferenceHz = 0.1f)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mindmachine.mvp
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
@@ -15,4 +16,37 @@ class SetupScreenUiLogicTest {
|
||||
fun setup_screen_layout_uses_scrollable_container() {
|
||||
assertTrue(setupScreenUsesScrollableContainer())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun setup_screen_unsaved_changes_true_when_timeline_dirty() {
|
||||
assertTrue(
|
||||
setupScreenHasUnsavedChanges(
|
||||
hasUnsavedTimelineChanges = true,
|
||||
editedProgramName = "Deep Release",
|
||||
savedProgramName = "Deep Release",
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun setup_screen_unsaved_changes_true_when_name_changed() {
|
||||
assertTrue(
|
||||
setupScreenHasUnsavedChanges(
|
||||
hasUnsavedTimelineChanges = false,
|
||||
editedProgramName = "Deep Release v2",
|
||||
savedProgramName = "Deep Release",
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun setup_screen_unsaved_changes_false_when_name_and_timeline_match() {
|
||||
assertFalse(
|
||||
setupScreenHasUnsavedChanges(
|
||||
hasUnsavedTimelineChanges = false,
|
||||
editedProgramName = "Deep Release",
|
||||
savedProgramName = "Deep Release",
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user