public void GetsCorrectPlayerFromOutsideIn(PlacedFormation placedFormation, Direction strongDirection, int number, int expectedPlayerIndex) { placedFormation.strongSide = strongDirection; PlacedPlayer expectedPlayer = placedFormation.skillPlayers[expectedPlayerIndex]; PlacedPlayer returnedPlayer = placedFormation.GetNumberedSkillWeak(FlowDirection.OutsideIn, number); bool samePlayer = ReferenceEquals(expectedPlayer, returnedPlayer); Assert.True(samePlayer); }
public void PassingTooLargeAValueThrowsExceptionWithProperMessage() { PlacedFormation placedFormation = new PlacedFormation(); PlacedFormationException ex = Assert.Throws <PlacedFormationException>(() => placedFormation.GetNumberedSkillWeak(FlowDirection.OutsideIn, 7)); Assert.Equal("Can't get numbers skill player larger then 6. There are only 6 skill players.", ex.Message); }
public void Passing0ThrowsExceptionWithProperMessage() { PlacedFormation placedFormation = new PlacedFormation(); PlacedFormationException ex = Assert.Throws <PlacedFormationException>(() => placedFormation.GetNumberedSkillWeak(FlowDirection.OutsideIn, 0)); Assert.Equal("Can't get 0 numbered skill player.", ex.Message); }