public List <PlayerReference> GetAdvancingPlayerReferences() { if (GetPlayState() != PlayStateEnum.Finished) { return(null); } return(AdvancingPlayersSolver.FetchFrom(this)); }
public void ThenAdvancingPlayersFromGroupFromFirstToLastShouldBeExactly(int groupIndex, string commaSeparatedPlayerNames) { GroupBase group = createdGroups[groupIndex]; List <string> expectedPlayerNameOrder = StringUtility.ToStringList(commaSeparatedPlayerNames, ","); List <PlayerReference> playerReferences = AdvancingPlayersSolver.FetchFrom(group); playerReferences.Should().HaveCount(expectedPlayerNameOrder.Count); for (int index = 0; index < playerReferences.Count; ++index) { playerReferences[index].Name.Should().Be(expectedPlayerNameOrder[index]); } }
public void ThenAdvancingPlayersFromRoundFromFirstToLastShouldBe(int roundIndex, string commaSeparatedPlayerNames) { RoundBase round = createdRounds[roundIndex]; List <string> expectedPlayerNameOrder = StringUtility.ToStringList(commaSeparatedPlayerNames, ","); List <PlayerReference> playerReferences = AdvancingPlayersSolver.FetchFrom(round); playerReferences.Should().HaveCount(expectedPlayerNameOrder.Count); for (int index = 0; index < playerReferences.Count; ++index) { playerReferences[index].Name.Should().Be(expectedPlayerNameOrder[index]); } }
public void ThenAdvancingPlayersInGroupIsExactly(int groupIndex, string commaSeparatedPlayerNames) { GroupBase group = createdGroups[groupIndex]; List <string> playerNames = StringUtility.ToStringList(commaSeparatedPlayerNames, ","); List <PlayerReference> playerReferences = AdvancingPlayersSolver.FetchFrom(group); playerReferences.Should().HaveCount(playerNames.Count); foreach (string playerName in playerNames) { playerReferences.FirstOrDefault(playerReference => playerReference.Name == playerName).Should().NotBeNull(); } }