package com.foxx.androidcast.stats;

/*********************************************************************
 * SessionStatsEventMapperTest.java
 * Created at: Tue 19 May 2026 19:43:06 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * class SessionStatsEventMapperTest
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 45 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	c2421f64b2b6674c82931e9c1982568447fac35fb9c51f090951f2be37b29501
**********************************************************************/
import static org.junit.Assert.assertEquals;

import com.foxx.androidcast.network.CastProtocol;

import org.junit.Test;

public class SessionStatsEventMapperTest {

    @Test
    public void videoKeyframe() {
        assertEquals(SessionStatsEventMapper.KF,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_VIDEO_FRAME, true));
        assertEquals(SessionStatsEventMapper.VIDEO,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_VIDEO_FRAME, false));
    }

    @Test
    public void audioAndMeta() {
        assertEquals(SessionStatsEventMapper.AUDIO,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_AUDIO_FRAME, false));
        assertEquals(SessionStatsEventMapper.META,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_STREAM_CONFIG, false));
        assertEquals(SessionStatsEventMapper.META,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_NETWORK_STATS, false));
    }

    @Test
    public void serviceAndUnknown() {
        assertEquals(SessionStatsEventMapper.SERVICE,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_HELLO, false));
        assertEquals(SessionStatsEventMapper.SERVICE,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_CODEC_SELECTED, false));
        assertEquals(SessionStatsEventMapper.UNKNOWN,
                SessionStatsEventMapper.eventTypeForMessage(CastProtocol.MSG_NACK, false));
    }
}
