Ejemplo n.º 1
0
        public void RoundtripRTCPByeUnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            uint ssrc = 23;

            RTCPBye bye = new RTCPBye(ssrc, null);

            byte[] buffer = bye.GetBytes();

            RTCPBye parsedBye = new RTCPBye(buffer);

            Assert.Equal(ssrc, parsedBye.SSRC);
            Assert.Null(parsedBye.Reason);
        }
Ejemplo n.º 2
0
        public void RoundtripRTCPByeOnBoundaryUnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            uint   ssrc   = 123121231;
            string reason = "1234567";

            RTCPBye bye = new RTCPBye(ssrc, reason);

            byte[] buffer = bye.GetBytes();

            RTCPBye parsedBye = new RTCPBye(buffer);

            Assert.Equal(16, buffer.Length);
            Assert.Equal(ssrc, parsedBye.SSRC);
            Assert.Equal(reason, parsedBye.Reason);
        }
Ejemplo n.º 3
0
        public void RoundtripByeWithTimeoutReasonUnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            uint   ssrc   = 19;
            string reason = RTCPSession.NO_ACTIVITY_TIMEOUT_REASON;

            RTCPBye bye = new RTCPBye(ssrc, reason);

            byte[] buffer = bye.GetBytes();

            RTCPBye parsedBye = new RTCPBye(buffer);

            Assert.Equal(32, buffer.Length);
            Assert.Equal(ssrc, parsedBye.SSRC);
            Assert.Equal(reason, parsedBye.Reason);
        }