Beispiel #1
0
        public void GivenPlayersIsRegisteredToRound(string commaSeparatedPlayerNames, string tournamentName)
        {
            List <string> playerNames = StringUtility.ToStringList(commaSeparatedPlayerNames, ",");

            using (TournamentRepository tournamentRepository = CreateTournamentRepository())
            {
                Tournament tournament = tournamentRepository.GetTournamentByName(tournamentName);

                foreach (string playerName in playerNames)
                {
                    tournamentRepository.AddPlayerReference(tournament, playerName);
                }

                tournamentRepository.Save();
            }
        }
        protected void InitializeRoundGroupAndPlayers()
        {
            using (TournamentRepository tournamentRepository = CreateTournamentRepository())
            {
                Tournament tournament = tournamentRepository.GetTournamentByName(tournamentName);

                RoundRobinRound round = tournamentRepository.AddRoundRobinRoundToTournament(tournament);
                tournamentRepository.SetPlayersPerGroupCountInRound(round, playerNames.Count);

                foreach (string playerName in playerNames)
                {
                    tournamentRepository.AddPlayerReference(tournament, playerName);
                }

                tournamentRepository.Save();
            }
        }