|
|
|
|
@ -99,7 +99,7 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let tournament = Tournament(event: eventId, name: "RG Homme", startDate: Date(), endDate: nil, creationDate: Date(), isPrivate: false, groupStageFormat: MatchFormat.megaTie, roundFormat: MatchFormat.nineGames, loserRoundFormat: MatchFormat.nineGamesDecisivePoint, groupStageSortMode: GroupStageOrderingMode.snake, groupStageCount: 2, rankSourceDate: Date(), dayDuration: 5, teamCount: 3, teamSorting: TeamSortingType.rank, federalCategory: TournamentCategory.mix, federalLevelCategory: TournamentLevel.p1000, federalAgeCategory: FederalTournamentAge.a45, closedRegistrationDate: Date(), groupStageAdditionalQualified: 4, courtCount: 9, prioritizeClubMembers: true, qualifiedPerGroupStage: 1, teamsPerGroupStage: 2, entryFee: 30.0, additionalEstimationDuration: 5, isDeleted: true, publishTeams: true, publishSummons: true, publishGroupStages: true, publishBrackets: true, shouldVerifyBracket: true, shouldVerifyGroupStage: true, hideTeamsWeight: true, publishTournament: true, hidePointsEarned: true, publishRankings: true) |
|
|
|
|
let tournament = Tournament(event: eventId, name: "RG Homme", startDate: Date(), endDate: nil, creationDate: Date(), isPrivate: false, groupStageFormat: MatchFormat.megaTie, roundFormat: MatchFormat.nineGames, loserRoundFormat: MatchFormat.nineGamesDecisivePoint, groupStageSortMode: GroupStageOrderingMode.snake, groupStageCount: 2, rankSourceDate: Date(), dayDuration: 5, teamCount: 3, teamSorting: TeamSortingType.rank, federalCategory: TournamentCategory.mix, federalLevelCategory: TournamentLevel.p1000, federalAgeCategory: FederalTournamentAge.a45, closedRegistrationDate: Date(), groupStageAdditionalQualified: 4, courtCount: 9, prioritizeClubMembers: true, qualifiedPerGroupStage: 1, teamsPerGroupStage: 2, entryFee: 30.0, additionalEstimationDuration: 5, isDeleted: true, publishTeams: true, publishSummons: true, publishGroupStages: true, publishBrackets: true, shouldVerifyBracket: true, shouldVerifyGroupStage: true, hideTeamsWeight: true, publishTournament: true, hidePointsEarned: true, publishRankings: true, loserBracketMode: .manual) |
|
|
|
|
let t = try await StoreCenter.main.service().post(tournament) |
|
|
|
|
|
|
|
|
|
assert(t.event == tournament.event) |
|
|
|
|
@ -139,6 +139,7 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
assert(t.publishTournament == tournament.publishTournament) |
|
|
|
|
assert(t.hidePointsEarned == tournament.hidePointsEarned) |
|
|
|
|
assert(t.publishRankings == tournament.publishRankings) |
|
|
|
|
assert(t.loserBracketMode == tournament.loserBracketMode) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func testGroupStage() async throws { |
|
|
|
|
@ -171,7 +172,7 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
let rounds: [Round] = try await StoreCenter.main.service().get() |
|
|
|
|
let parentRoundId = rounds.first?.id |
|
|
|
|
|
|
|
|
|
let round = Round(tournament: tournamentId, index: 1, parent: parentRoundId, matchFormat: MatchFormat.nineGames, startDate: Date()) |
|
|
|
|
let round = Round(tournament: tournamentId, index: 1, parent: parentRoundId, matchFormat: MatchFormat.nineGames, startDate: Date(), groupStageLoserBracket: false, loserBracketMode: .manual) |
|
|
|
|
let r: Round = try await StoreCenter.main.service().post(round) |
|
|
|
|
|
|
|
|
|
assert(r.tournament == round.tournament) |
|
|
|
|
@ -179,6 +180,8 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
assert(r.parent == round.parent) |
|
|
|
|
assert(r.matchFormat == round.matchFormat) |
|
|
|
|
assert(r.startDate != nil) |
|
|
|
|
assert(r.groupStageLoserBracket == round.groupStageLoserBracket) |
|
|
|
|
assert(r.loserBracketMode == round.loserBracketMode) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|