public void MinorThenDoubleMinorAndDoubleMinorShouldKvittas()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMinor(true) });
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateDoubleMinor(true, StartTimeTwoMinutes), PenaltyCreator.CreateDoubleMinor(false, StartTimeTwoMinutes) });

            Assert.AreEqual(PlayersOnIce.FourOnFive, _penaltyBox.PlayersOnIce);
        }
        public void MinorPlusDoubleMinorPlusMinorAndMinorPlusMinorShouldBeFourOnFiveForFourMinutes()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMinor(true), PenaltyCreator.CreateDoubleMinor(true), PenaltyCreator.CreateMinor(true), PenaltyCreator.CreateMinor(false), PenaltyCreator.CreateMinor(false) });

            Assert.AreEqual(PlayersOnIce.FourOnFive, _penaltyBox.PlayersOnIce);
            Assert.AreEqual(2, _penaltyBox.PenaltyScoreBoard.Home.Count());
            Assert.AreEqual(340, _penaltyBox.PenaltyScoreBoard.Home.Last().EndTime);
        }
Beispiel #3
0
        public void ShouldSplitDoubleMinor()
        {
            _penaltyList.Add(PenaltyCreator.CreateDoubleMinor(true));

            var split = _penaltyList.SplitIntoMultiplePenalties().ToList();

            Assert.AreEqual(2, split.Count());
            Assert.AreEqual(true, split.First().PenaltyIsMinor);
            Assert.AreEqual(true, split.Last().PenaltyIsMinor);
        }
        public void DoubleMinorPlusDoubleMinorAndMajorPlusDoubleMinorPlusMinorShouldBeFourOnFourForTwoMinutes()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateDoubleMinor(true), PenaltyCreator.CreateDoubleMinor(true), PenaltyCreator.CreateMajorAndGame(false), PenaltyCreator.CreateDoubleMinor(false), PenaltyCreator.CreateMinor(false) });

            Assert.AreEqual(PlayersOnIce.FourOnFour, _penaltyBox.PlayersOnIce);

            //Expire minors
            var ex = _penaltyBox.PenaltiesThatExpireThisSecond(220).ToList();

            _penaltyBox.ExpirePenalties(ex);

            Assert.AreEqual(PlayersOnIce.FiveOnFour, _penaltyBox.PlayersOnIce);

            //Expire Major
            var ex2 = _penaltyBox.PenaltiesThatExpireThisSecond(400).ToList();

            _penaltyBox.ExpirePenalties(ex2);

            Assert.AreEqual(PlayersOnIce.FiveOnFive, _penaltyBox.PlayersOnIce);

            //Assert.AreEqual(2, _penaltyBox.PenaltyScoreBoard.Home.Count());
            //Assert.AreEqual(340, _penaltyBox.PenaltyScoreBoard.Home.Last().EndTime);
        }
        public void DoubleMinorPlusMinorAndMinorPlusMinorShouldKvittasWhenFiveOnFive()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateDoubleMinor(true), PenaltyCreator.CreateMinor(true), PenaltyCreator.CreateMinor(false), PenaltyCreator.CreateMinor(false) });

            Assert.AreEqual(PlayersOnIce.FourOnFive, _penaltyBox.PlayersOnIce);
        }