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

            Assert.AreEqual(PlayersOnIce.ThreeOnFive, _penaltyBox.PlayersOnIce);
        }
        public void MinorAndMinorShouldKvittasWhenNotFiveOnFive()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMinor(true), PenaltyCreator.CreateMinor(false) });
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMinor(true, StartTimeTwoMinutes), PenaltyCreator.CreateMinor(false, StartTimeTwoMinutes) });

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

            Assert.AreEqual(PlayersOnIce.FourOnFour, _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);
        }
Пример #5
0
        public void ShouldNotSplitMinor()
        {
            _penaltyList.Add(PenaltyCreator.CreateMinor(true));

            var split = _penaltyList.SplitIntoMultiplePenalties();

            Assert.AreEqual(1, split.Count());
        }
        public void FirstInFirstOut()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMajor(false), PenaltyCreator.CreateMinor(false) });

            Assert.AreEqual(PlayersOnIce.FiveOnThree, _penaltyBox.PlayersOnIce);
        }
Пример #7
0
        public void ThreeMinorsShouldPostponeLastPenalty()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMinor(false), PenaltyCreator.CreateMinor(false), PenaltyCreator.CreateMinor(false) });

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

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

            Assert.AreEqual(PlayersOnIce.FiveOnThree, _penaltyBox.PlayersOnIce);
        }
        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);
        }