コード例 #1
0
            public void GetsCorrectPlayerFromOutsideIn(PlacedFormation placedFormation, Direction strongDirection,
                                                       int number, int expectedPlayerIndex)
            {
                placedFormation.strongSide = strongDirection;
                PlacedPlayer expectedPlayer = placedFormation.skillPlayers[expectedPlayerIndex];

                PlacedPlayer returnedPlayer = placedFormation.GetNumberedSkillStrong(FlowDirection.OutsideIn, number);
                bool         samePlayer     = ReferenceEquals(expectedPlayer, returnedPlayer);

                Assert.True(samePlayer);
            }
コード例 #2
0
            public void PassingTooLargeAValueThrowsExceptionWithProperMessage()
            {
                PlacedFormation          placedFormation = new PlacedFormation();
                PlacedFormationException ex = Assert.Throws <PlacedFormationException>(() => placedFormation.GetNumberedSkillStrong(FlowDirection.OutsideIn, 7));

                Assert.Equal("Can't get numbers skill player larger then 6. There are only 6 skill players.", ex.Message);
            }
コード例 #3
0
            public void Passing0ThrowsExceptionWithProperMessage()
            {
                PlacedFormation          placedFormation = new PlacedFormation();
                PlacedFormationException ex = Assert.Throws <PlacedFormationException>(() => placedFormation.GetNumberedSkillStrong(FlowDirection.OutsideIn, 0));

                Assert.Equal("Can't get 0 numbered skill player.", ex.Message);
            }