コード例 #1
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
        }
コード例 #2
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
        }