package com.tsmobile.app.voice

import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test

class MixedPcmFrameTest {
    @Test
    fun acceptsOnlyFixedTwentyMillisecondStereoPcmFrames() {
        assertTrue(MixedPcmFrame.CHANNELS == 2)
        assertTrue(MixedPcmFrame.SAMPLES_PER_CHANNEL == 960)
        assertTrue(MixedPcmFrame.BYTES_PER_FRAME == 3_840)
        assertTrue(MixedPcmFrame.isValid(ByteArray(MixedPcmFrame.BYTES_PER_FRAME)))
        assertFalse(MixedPcmFrame.isValid(ByteArray(MixedPcmFrame.BYTES_PER_FRAME - 1)))
        assertFalse(MixedPcmFrame.isValid(ByteArray(MixedPcmFrame.BYTES_PER_FRAME + 1)))
    }
}
