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);
        }
Ejemplo n.º 5
0
        public void ShouldNotSplitMinor()
        {
            _penaltyList.Add(PenaltyCreator.CreateMinor(true));

            var split = _penaltyList.SplitIntoMultiplePenalties();

            Assert.AreEqual(1, split.Count());
        }
Ejemplo n.º 6
0
        public void ShouldSplitMajorAndGame()
        {
            _penaltyList.Add(PenaltyCreator.CreateMajorAndGame(true));

            var split = _penaltyList.SplitIntoMultiplePenalties();

            Assert.AreEqual(2, split.Count());
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
0
        public void ShouldSplitMinorAndMisconduct()
        {
            _penaltyList.Add(PenaltyCreator.CreateMinorAndMisconduct(true));

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

            Assert.AreEqual(2, split.Count());
            Assert.AreEqual(true, split.First().PenaltyIsMinor);
            Assert.AreEqual(true, split.Last().PenaltyIsMisconduct);
            Assert.AreEqual(false, 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 FirstInFirstOut()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMajor(false), PenaltyCreator.CreateMinor(false) });

            Assert.AreEqual(PlayersOnIce.FiveOnThree, _penaltyBox.PlayersOnIce);
        }
Ejemplo n.º 11
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 MajorAndMajorShouldKvittasWhenFiveOnFive()
        {
            _penaltyBox.AddPenalties(new[] { PenaltyCreator.CreateMajorAndGame(true), PenaltyCreator.CreateMajorAndGame(false) });

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