示例#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();
        }
示例#2
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();
        }
示例#3
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
        }