Exemplo n.º 1
0
        public void StartTest3()
        {
            PlayControl target = new PlayControl();

            count = 0;
            target.Stop();
            target.Start(() => TestAction());
            Thread.Sleep(200);
            Assert.AreEqual(PlayControl.States.Playing, target.State);
            target.Stop();
        }
Exemplo n.º 2
0
        public void ErrorTest()
        {
            PlayControl target = new PlayControl();

            target.Failed   += new EventHandler <PlayControlFailedEventArgs>(target_Failed);
            _FailedException = null;
            count            = 0;
            target.Start(() => ErrorAction());
            Thread.Sleep(200);
            Assert.AreEqual(PlayControl.States.Error, target.State);
            Assert.IsTrue(_FailedException is System.IO.IOException);
        }
Exemplo n.º 3
0
        public void StopTest()
        {
            PlayControl target = new PlayControl();

            count = 0;
            target.Start(() => TestAction());
            Thread.Sleep(200);
            target.Stop();
            //allow some time for the thread to change state
            Thread.Sleep(200);
            Assert.IsTrue(count > 0);
            Assert.AreEqual(PlayControl.States.Stopped, target.State);
            CheckCountNotIncreasing();
        }
Exemplo n.º 4
0
        public void PauseTest()
        {
#if DEBUG
            PlayControl target = new PlayControl();
            count = 0;
            target.Start(() => TestAction());
            Thread.Sleep(1000);
            target.Pause();
            //allow some time for the thread to change state
            Thread.Sleep(1000);
            Assert.IsTrue(count > 0);
            Assert.AreEqual(PlayControl.States.Paused, target.State);
            CheckCountNotIncreasing();
#endif
        }
Exemplo n.º 5
0
        public void PlayTest()
        {
#if DEBUG
            PlayControl target = new PlayControl();
            count = 0;
            target.Start(() => TestAction());
            Thread.Sleep(200);
            target.Pause();
            //allow some time for the thread to change state
            Thread.Sleep(200);
            int countCheck = count;
            target.Play();
            //allow some time for the thread to change state
            Thread.Sleep(300);
            Assert.AreEqual(PlayControl.States.Playing, target.State);
            //check that count is increasing
            Assert.IsTrue(count > countCheck);
            target.Stop();
#endif
        }
Exemplo n.º 6
0
        public void StartTest1()
        {
            PlayControl target = new PlayControl();

            target.Start(null);
        }