public ButtHitSeatCommandHandlerTests()
        {
            _handler = new ButtHitSeatCommandHandler(_boutRunner);
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state   = _boutRunner.GetBoutState(Guid.Empty);
            _builder = new BoutStateBuilder(_state);
            _builder.SetPhase(BoutPhase.Jam);
        }
        public CreatePassCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state       = _boutRunner.GetBoutState(Guid.Empty);
            _state.Phase = BoutPhase.Jam;

            _handler = new CreatePassCommandHandler(_boutRunner);
        }
Exemplo n.º 3
0
        public CreatePenaltyCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state       = _boutRunner.GetBoutState(Guid.Empty);
            _state.Phase = BoutPhase.Lineup;

            _handler = new CreatePenaltyCommandHandler(_boutRunner, _boutData);
        }
        public StopTimeoutCommandHandlerTests()
        {
            _handler = new StopTimeoutCommandHandler(_boutRunner);
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            var state = _boutRunner.GetBoutState(Guid.Empty);

            state.Phase             = BoutPhase.Timeout;
            state.GameClock.Running = false;
        }
Exemplo n.º 5
0
        public AddSkaterToJamCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            var state = _boutRunner.GetBoutState(Guid.Empty);

            state.Phase = BoutPhase.Lineup;

            _handler = new AddSkaterToJamCommandHandler(_boutData, _boutRunner);
        }
        public SetLoseOfficialReviewCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            var state = _boutRunner.GetBoutState(Guid.Empty);

            state.Phase             = BoutPhase.Timeout;
            state.GameClock.Running = false;
            _handler = new SetLoseOfficialReviewCommandHandler(_boutRunner);
        }
        public ReleaseSkaterCommandHandlerTests()
        {
            _handler = new ReleaseSkaterCommandHandler(_boutRunner);
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state    = _boutRunner.GetBoutState(Guid.Empty);
            _builder  = new BoutStateBuilder(_state);
            _toUpdate = _builder.AddSkaterToBox(team: "left", number: 8);
            _command  = new ReleaseSkaterCommand(Guid.Empty, "o", _toUpdate.Id);
        }
Exemplo n.º 8
0
        public CancelSitCommandHandlerTests()
        {
            _command = new CancelSitCommand(Guid.Empty, "o", _toUpdate.Id);
            _handler = new CancelSitCommandHandler(_boutRunner);
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state = _boutRunner.GetBoutState(Guid.Empty);
            _state.PenaltyBox.Add(_toUpdate);
            _state.Phase = BoutPhase.Jam;
        }
        public UpdatePenaltyCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state    = _boutRunner.GetBoutState(Guid.Empty);
            _builder  = new BoutStateBuilder(_state);
            _penalty1 = _builder.AddPenalty();

            _handler         = new UpdatePenaltyCommandHandler(_boutRunner);
            _penalty2.Id     = _penalty1.Id;
            _penalty2.Number = 8;
            _command         = new UpdatePenaltyCommand(Guid.Empty, "originator", _penalty2);
        }
Exemplo n.º 10
0
        public UpdatePassCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state       = _boutRunner.GetBoutState(Guid.Empty);
            _state.Phase = BoutPhase.Jam;
            var team = _state.Jams[0].Team("left");

            team.Passes.Add(new Pass {
                Number = 1
            });
            _handler = new UpdatePassCommandHandler(_boutRunner);
        }
        public RemoveSkaterFromJamCommandHandlerTests()
        {
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            var state = _boutRunner.GetBoutState(Guid.Empty);

            state.Phase = BoutPhase.Lineup;
            var team = state.Jams[0].Team("left");

            team.Roster.Add(new JamParticipant {
                Number = 8, Position = Position.Blocker
            });
            _handler = new RemoveSkaterFromJamCommandHandler(_boutRunner);
        }
Exemplo n.º 12
0
        public UpdateChairCommandHandlerTests()
        {
            _handler = new UpdateChairCommandHandler(_boutRunner, _boutData);
            var bout = _boutData.Load(Guid.Empty);

            _boutRunner.StartBout(bout);
            _state   = _boutRunner.GetBoutState(Guid.Empty);
            _builder = new BoutStateBuilder(_state);
            var inBox = _builder.AddSkaterToBox(number: -1);

            _command = new UpdateChairCommand(Guid.Empty, "originator",
                                              new Chair {
                Id = inBox.Id, Team = "left", IsJammer = false, Number = 8
            });
        }
Exemplo n.º 13
0
        public override ICommandResponse Handle(RunBoutCommand command)
        {
            var response = new CommandResponse();
            var bout     = _boutDataService.Load(command.BoutId);

            if (_boutRunnerService.IsRunning(bout.BoutId))
            {
                throw new BoutAlreadyRunningException(bout.BoutId);
            }

            _boutRunnerService.StartBout(bout);
            response.AddEvent(new BoutRunningEvent(bout.BoutId, bout.Name), Audiences.All);

            return(response);
        }
 public StartPeriodCommandHandlerTests()
 {
     var bout = _boutData.Load(Guid.Empty);
     _boutRunner.StartBout(bout);
 }