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; }
public void CanChangeAdvancingPerGroupCount() { RoundRobinRound round = tournament.AddRoundRobinRound(); round.AdvancingPerGroupCount.Should().Be(1); round.SetAdvancingPerGroupCount(4); round.AdvancingPerGroupCount.Should().Be(4); }
public void CannotRenameRoundToEmptyname() { RoundRobinRound round = tournament.AddRoundRobinRound(); round.RenameTo(""); round.Name.Should().Be("Round A"); }
public void CanFetchLastRound() { tournament.AddBracketRound(); tournament.AddDualTournamentRound(); RoundRobinRound lastRound = tournament.AddRoundRobinRound(); tournament.GetLastRound().Should().Be(lastRound); }
public void CanRenameRound() { string newName = "New Round Name"; RoundRobinRound round = tournament.AddRoundRobinRound(); round.RenameTo(newName); round.Name.Should().Be(newName); }
public void CanExcludePlayerReferencesFromTournament() { string playerName = "Maru"; RoundRobinRound round = tournament.AddRoundRobinRound(); tournament.RegisterPlayerReference(playerName); bool exclusionResult = tournament.ExcludePlayerReference(playerName); exclusionResult.Should().BeTrue(); tournament.PlayerReferences.Should().BeEmpty(); }
public void CannotSetAdvancingPerGroupCountToAnythingLessThanOne() { RoundRobinRound round = tournament.AddRoundRobinRound(); round.AdvancingPerGroupCount.Should().Be(1); round.SetPlayersPerGroupCount(0); round.SetPlayersPerGroupCount(-1); round.SetPlayersPerGroupCount(-2); round.AdvancingPerGroupCount.Should().Be(1); }
public void CanChangePlayersPerGroupSize() { RoundRobinRound round = tournament.AddRoundRobinRound(); round.Groups.First().Matches.Should().HaveCount(1); round.PlayersPerGroupCount.Should().Be(2); round.SetPlayersPerGroupCount(4); round.Groups.First().Matches.Should().HaveCount(6); round.PlayersPerGroupCount.Should().Be(4); }
public void CannotRenameRoundToTheSameAsOtherRoundNoMatterLetterCasing() { RoundRobinRound firstRound = tournament.AddRoundRobinRound(); RoundRobinRound secondRound = tournament.AddRoundRobinRound(); string newName = "New Round Name"; string initialRoundName = secondRound.Name; firstRound.RenameTo(newName); secondRound.RenameTo(newName.ToLower()); firstRound.Name.Should().Be(newName); secondRound.Name.Should().Be(initialRoundName); }
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"); }
public void CannotSetPlayersPerGroupSizeToAnythingLessThanTwo() { RoundRobinRound round = tournament.AddRoundRobinRound(); round.Groups.First().Matches.Should().HaveCount(1); round.PlayersPerGroupCount.Should().Be(2); round.SetPlayersPerGroupCount(1); round.SetPlayersPerGroupCount(0); round.SetPlayersPerGroupCount(-1); round.Groups.First().Matches.Should().HaveCount(1); round.PlayersPerGroupCount.Should().Be(2); }
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); }
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(); } }
public static RoundRobinGroup Create(RoundRobinRound round) { if (round == null) { return(null); } RoundRobinGroup group = new RoundRobinGroup() { RoundId = round.Id, Round = round }; group.AssignDefaultName(); return(group); }
public RoundRobinRound AddRoundRobinRound() { RoundRobinRound round = RoundRobinRound.Create(this); if (round == null) { return(null); } bool roundWasIntegrated = IntegrateRoundToTournament(round); if (roundWasIntegrated) { return(round); } return(null); }
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; }
public RoundRobinGroupTests() { tournament = Tournament.Create("GSL 2019"); round = tournament.AddRoundRobinRound() as RoundRobinRound; }