public void StoppedMediaNoStartedTest()
        {
            // Act
            RtspStreamerLib.StopStreamLib(_rtspLib);
            bool streaming = RtspStreamerLib.GetStreamStatusLib(_rtspLib);
            int  status    = Wait(() => RtspStreamerLib.GetStreamRateLib(_rtspLib), s => s == RtspStreamerLib.STATUS_UNKNOWN);

            // Assert
            Assert.AreEqual(status, RtspStreamerLib.STATUS_UNKNOWN);
            Assert.IsFalse(streaming);
        }
        public void NotFoundMediaFileTest(byte[] mediaFile)
        {
            // Act
            int  code      = RtspStreamerLib.StartStreamLib(_rtspLib, _streamName, mediaFile, RTSP_PORT_I);
            bool streaming = RtspStreamerLib.GetStreamStatusLib(_rtspLib);
            int  status    = Wait(() => RtspStreamerLib.GetStreamRateLib(_rtspLib), s => s == RtspStreamerLib.STATUS_UNKNOWN);

            // Assert
            Assert.AreEqual(code, RtspStreamerLib.CODE_ERROR);
            Assert.AreEqual(status, RtspStreamerLib.STATUS_UNKNOWN);
            Assert.IsFalse(streaming);
        }
        public void IncorrectPortTest(int port)
        {
            // Act
            int  code      = RtspStreamerLib.StartStreamLib(_rtspLib, _streamName, _mediaFile, port);
            bool streaming = RtspStreamerLib.GetStreamStatusLib(_rtspLib);
            int  status    = Wait(() => RtspStreamerLib.GetStreamRateLib(_rtspLib), s => s == RtspStreamerLib.STATUS_UNKNOWN);

            // Assert
            Assert.AreEqual(code, RtspStreamerLib.CODE_ERROR);
            Assert.AreEqual(status, RtspStreamerLib.STATUS_UNKNOWN);
            Assert.IsFalse(streaming);
        }
        public void PlayingMediaTest()
        {
            // Act
            int  code      = RtspStreamerLib.StartStreamLib(_rtspLib, _streamName, _mediaFile, RTSP_PORT_I);
            bool streaming = RtspStreamerLib.GetStreamStatusLib(_rtspLib);
            int  status    = Wait(() => RtspStreamerLib.GetStreamRateLib(_rtspLib), s => s == RtspStreamerLib.STATUS_PLAYING);

            // Assert
            Assert.AreNotEqual(_rtspLib, IntPtr.Zero);
            Assert.AreEqual(code, RtspStreamerLib.CODE_SUCCESS);
            Assert.AreEqual(status, RtspStreamerLib.STATUS_PLAYING);
            Assert.IsTrue(streaming);
        }
        public void StoppedMediaTest()
        {
            // Arrage
            PlayingMediaTest();

            // Act
            RtspStreamerLib.StopStreamLib(_rtspLib);
            bool streaming = RtspStreamerLib.GetStreamStatusLib(_rtspLib);
            int  status    = Wait(() => RtspStreamerLib.GetStreamRateLib(_rtspLib), s => s == RtspStreamerLib.STATUS_STOPPED);

            // Assert
            Assert.AreEqual(status, RtspStreamerLib.STATUS_STOPPED);
            Assert.IsFalse(streaming);
        }