Esempio n. 1
0
        public void TimerTest2()
        {
            IPlayer player1 = new Player();
            IPlayer player2 = new Player();

            List <IPlayer> players = new List <IPlayer>
            {
                player1,
                player2
            };

            TimerFactory timerFattory = new TimerFactory();
            ITimer       timer        = timerFattory.EqualTimer(players, 10);

            Assert.Equal(10, (int)timer.GetRemainingTime(player1));
            timer.Start(player1);
            timer.SwitchPlayer(player2);
            Thread.Sleep(2000);
            Assert.Equal(7, (int)timer.GetRemainingTime(player2));
        }