Ejemplo n.º 1
0
 public void StartRound()
 {
     _fightState.Round++;
     _fightState.SetMode("fight");
     _fightState.Started = true;
     _fightState.Paused  = false;
     _fightState.StartTimer();
 }
Ejemplo n.º 2
0
        public void SetMode_ShouldSetModeToPause()
        {
            var context = new Mocks().GetDefaultDatabaseContext();

            var fightEntity = new Fight
            {
                Id            = 1,
                BlueAthleteId = "abcd",
                RedAthleteId  = "efgh",
                Structure     = new FightStructure()
                {
                    Round = new Round()
                    {
                        BreakDuration = 1000,
                        Duration      = 3000,
                        RoundsCount   = 3
                    }
                }
            };

            context.Fights.Add(fightEntity);
            context.SaveChanges();

            var state = new FightState(context);

            state.Initialize(1);

            state.SetMode("pause");
            Assert.Equal(state.RemainingTime, 1000);
        }