Ejemplo n.º 1
0
        public void CanChangeAdvancingPerGroupCount()
        {
            RoundRobinRound round = tournament.AddRoundRobinRound();

            round.AdvancingPerGroupCount.Should().Be(1);
            round.SetAdvancingPerGroupCount(4);
            round.AdvancingPerGroupCount.Should().Be(4);
        }
Ejemplo n.º 2
0
        public void CanFetchFirstRound()
        {
            tournament.AddBracketRound();
            tournament.AddDualTournamentRound();
            tournament.AddRoundRobinRound();

            tournament.GetFirstRound().Should().Be(bracketRound);
        }
Ejemplo n.º 3
0
        public void CanRegisterPlayerReferencesToTournament()
        {
            string playerName = "Maru";

            RoundRobinRound round = tournament.AddRoundRobinRound();

            PlayerReference playerReference = tournament.RegisterPlayerReference(playerName);

            playerReference.Id.Should().NotBeEmpty();
            playerReference.Name.Should().Be(playerName);
            playerReference.TournamentId.Should().Be(round.TournamentId);
            playerReference.Tournament.Should().Be(round.Tournament);

            tournament.PlayerReferences.First().Should().Be(playerReference);
        }
Ejemplo n.º 4
0
 public RoundRobinStartDateTimeTests()
 {
     tournament = Tournament.Create("GSL 2019");
     tournamentIssueReporter = tournament.TournamentIssueReporter;
     roundRobinRound         = tournament.AddRoundRobinRound() as RoundRobinRound;
     tournament.AddBracketRound();
 }
        public RoundRobinGroupLayoutAssemblerTests()
        {
            tournament      = Tournament.Create("GSL 2019");
            roundRobinRound = tournament.AddRoundRobinRound() as RoundRobinRound;
            roundRobinGroup = RoundRobinGroup.Create(roundRobinRound);

            playerReferences = new List <PlayerReference>();
            playerReferences.Add(PlayerReference.Create("Maru", tournament));
            playerReferences.Add(PlayerReference.Create("Stork", tournament));
            playerReferences.Add(PlayerReference.Create("Taeja", tournament));
            playerReferences.Add(PlayerReference.Create("Rain", tournament));
            playerReferences.Add(PlayerReference.Create("Bomber", tournament));
            playerReferences.Add(PlayerReference.Create("FanTaSy", tournament));
            playerReferences.Add(PlayerReference.Create("Stephano", tournament));
            playerReferences.Add(PlayerReference.Create("Thorzain", tournament));

            maruId     = playerReferences[0].Id;
            storkId    = playerReferences[1].Id;
            taejaId    = playerReferences[2].Id;
            rainId     = playerReferences[3].Id;
            bomberId   = playerReferences[4].Id;
            fantasyId  = playerReferences[5].Id;
            stephanoId = playerReferences[6].Id;
            thorzainId = playerReferences[7].Id;
        }
Ejemplo n.º 6
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.º 7
0
        public PlayerInRoundRobinGroupTests()
        {
            tournament = Tournament.Create("GSL 2019");
            round      = tournament.AddRoundRobinRound();
            round.SetAdvancingPerGroupCount(1);
            round.SetPlayersPerGroupCount(4);

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

            group = round.Groups.First() as RoundRobinGroup;
            match = group.Matches.First();
            match.SetBestOf(5);

            player = match.Player1;
        }
Ejemplo n.º 8
0
 public RoundRobinGroupTests()
 {
     tournament = Tournament.Create("GSL 2019");
     round      = tournament.AddRoundRobinRound() as RoundRobinRound;
 }
Ejemplo n.º 9
0
        public void AddingSeveralRoundsYieldsRoundsWithExpectedNames()
        {
            RoundRobinRound firstRound  = tournament.AddRoundRobinRound();
            RoundRobinRound secondRound = tournament.AddRoundRobinRound();
            RoundRobinRound thirdRound  = tournament.AddRoundRobinRound();
            RoundRobinRound fourthRound = tournament.AddRoundRobinRound();
            RoundRobinRound fifthRound  = tournament.AddRoundRobinRound();

            firstRound.Name.Should().Be("Round A");
            secondRound.Name.Should().Be("Round B");
            thirdRound.Name.Should().Be("Round C");
            fourthRound.Name.Should().Be("Round D");
            fifthRound.Name.Should().Be("Round E");
        }
Ejemplo n.º 10
0
 public PlayerReferenceTests()
 {
     tournament = Tournament.Create("GSL 2019");
     tournament.AddRoundRobinRound();
 }
Ejemplo n.º 11
0
 public RoundRobinRound AddRoundRobinRoundToTournament(Tournament tournament)
 {
     return(tournament.AddRoundRobinRound());
 }