コード例 #1
0
        public void JammerSwapHappens()
        {
            _builder.AddSkaterToBox(team: "right", number: 868, chairNumber: 2, isJammer: true, secondsServed: 15);
            _command.Chair.IsJammer = true;

            _handler.Handle(_command);

            Assert.Contains(_state.PenaltyBox, x => x.Team == "left" && x.SecondsOwed == 15);
            Assert.Contains(_state.PenaltyBox, x => x.Team == "right" && x.SecondsOwed == 15);
        }
コード例 #2
0
 public void SetsTimeIfChangedToLessNaughtySkater()
 {
     _builder.AddSkaterToBox(number: 8, secondsOwed: 60);
     _builder.AddPenalty(number: 23);
     _command.Chair.Number      = 23;
     _command.Chair.SecondsOwed = 30;
     _handler.Handle(_command);
     Assert.Contains(_state.PenaltyBox, x => x.SecondsOwed == 30 && x.Number == 23);
 }
コード例 #3
0
        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);
        }
コード例 #4
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
            });
        }
コード例 #5
0
 public void SkaterInBoxGetsTimeAdded()
 {
     _builder.AddSkaterToBox(number: 8);
     _handler.Handle(_command);
     Assert.Contains(_state.PenaltyBox, x => x.Number == 8 && x.SecondsOwed == 60);
 }