Ejemplo n.º 1
0
        public void CanFetchFirstRound()
        {
            tournament.AddBracketRound();
            tournament.AddDualTournamentRound();
            tournament.AddRoundRobinRound();

            tournament.GetFirstRound().Should().Be(bracketRound);
        }
Ejemplo n.º 2
0
        public void CanCreateDualTournamentRound()
        {
            DualTournamentRound round = tournament.AddDualTournamentRound();

            round.Should().NotBeNull();
            round.Id.Should().NotBeEmpty();
            round.Name.Should().Be("Round A");
            round.PlayersPerGroupCount.Should().Be(4);
            round.AdvancingPerGroupCount.Should().Be(2);
            round.Groups.Should().HaveCount(1);
            round.TournamentId.Should().Be(tournament.Id);
            round.Tournament.Should().Be(tournament);
        }
 public DualTournamentStartDateTimeTests()
 {
     tournament = Tournament.Create("GSL 2019");
     tournamentIssueReporter = tournament.TournamentIssueReporter;
     dualTournamentRound     = tournament.AddDualTournamentRound() as DualTournamentRound;
     tournament.AddBracketRound();
 }
Ejemplo n.º 4
0
        public void AddingEnoughRoundsToUseAllSingleLetterRestartsLetteringWithTwoLetters()
        {
            for (int index = 0; index < 10; ++index)
            {
                tournament.AddBracketRound();
                tournament.AddDualTournamentRound();
                tournament.AddRoundRobinRound();
            }

            tournament.Rounds[26].Name.Should().Be("Round AA");
            tournament.Rounds[27].Name.Should().Be("Round AB");
            tournament.Rounds[28].Name.Should().Be("Round AC");
            tournament.Rounds[29].Name.Should().Be("Round AD");
        }
Ejemplo n.º 5
0
        public void GivenTournamentAddsRounds(int tournamentIndex, Table table)
        {
            if (createdTournaments.Count <= tournamentIndex)
            {
                throw new IndexOutOfRangeException("Given tournament index is out of bounds");
            }

            Tournament tournament = createdTournaments[tournamentIndex];

            foreach (TableRow row in table.Rows)
            {
                TestUtilities.ParseRoundTable(row, out ContestTypeEnum contestType, out string name, out int advancingCount, out int playersPerGroupCount);

                if (contestType != ContestTypeEnum.None)
                {
                    RoundBase round = null;

                    if (contestType == ContestTypeEnum.Bracket)
                    {
                        round = tournament.AddBracketRound();
                    }
                    else if (contestType == ContestTypeEnum.DualTournament)
                    {
                        round = tournament.AddDualTournamentRound();
                    }
                    else if (contestType == ContestTypeEnum.RoundRobin)
                    {
                        round = tournament.AddRoundRobinRound();
                    }

                    if (round == null)
                    {
                        return;
                    }

                    round.RenameTo(name);
                    round.SetAdvancingPerGroupCount(advancingCount);
                    round.SetPlayersPerGroupCount(playersPerGroupCount);

                    createdRounds.Add(round);

                    if (round != null)
                    {
                        createdGroups.AddRange(round.Groups);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public PlayerInDualTournamentGroupTests()
        {
            tournament = Tournament.Create("GSL 2019");
            round      = tournament.AddDualTournamentRound();
            round.SetAdvancingPerGroupCount(2);
            round.SetPlayersPerGroupCount(4);

            // Needed for the tournament flow to make sense, tournament cannot end with a dual tournament group
            tournament.AddBracketRound();

            foreach (string playerName in playerNames)
            {
                tournament.RegisterPlayerReference(playerName);
            }

            tournament.RegisterPlayerReference("Stork");
            group = round.Groups.First() as DualTournamentGroup;
            match = group.Matches.First();
            match.SetBestOf(5);

            player = match.Player1;
        }
Ejemplo n.º 7
0
 private void TurnTournamentInvalid()
 {
     tournament.AddDualTournamentRound();
 }
Ejemplo n.º 8
0
 public DualTournamentRound AddDualTournamentRoundToTournament(Tournament tournament)
 {
     return(tournament.AddDualTournamentRound());
 }
Ejemplo n.º 9
0
 public DualTournamentGroupTests()
 {
     tournament          = Tournament.Create("GSL 2019");
     dualTournamentRound = tournament.AddDualTournamentRound() as DualTournamentRound;
 }