|
|
|
|
@ -113,7 +113,10 @@ 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, shouldVerifyGroupStage: true, shouldVerifyBracket: true, hideTeamsWeight: true, publishTournament: true, hidePointsEarned: true, publishRankings: true, loserBracketMode: .manual, initialSeedRound: 8, initialSeedCount: 4, accountIsRequired: false, licenseIsRequired: false, minimumPlayerPerTeam: 3, maximumPlayerPerTeam: 5, information: "Super", umpireCustomMail: "razmig@padelclub.app", umpireCustomContact: "Raz", umpireCustomPhone: "+33681598193", hideUmpireMail: true, hideUmpirePhone: true, disableRankingFederalRuling: true, teamCountLimit: false, enableOnlinePayment: false, onlinePaymentIsMandatory: false, enableOnlinePaymentRefund: false, refundDateLimit: nil, stripeAccountId: nil, enableTimeToConfirm: false, isCorporateTournament: false, isTemplate: false |
|
|
|
|
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, shouldVerifyGroupStage: true, shouldVerifyBracket: true, hideTeamsWeight: true, publishTournament: true, hidePointsEarned: true, publishRankings: true, loserBracketMode: .manual, initialSeedRound: 8, initialSeedCount: 4, accountIsRequired: false, licenseIsRequired: false, minimumPlayerPerTeam: 3, maximumPlayerPerTeam: 5, information: "Super", umpireCustomMail: "razmig@padelclub.app", umpireCustomContact: "Raz", umpireCustomPhone: "+33681598193", hideUmpireMail: true, hideUmpirePhone: true, disableRankingFederalRuling: true, teamCountLimit: false, enableOnlinePayment: false, onlinePaymentIsMandatory: false, enableOnlinePaymentRefund: false, refundDateLimit: nil, stripeAccountId: nil, enableTimeToConfirm: false, isCorporateTournament: false, isTemplate: false, |
|
|
|
|
publishProg: true, |
|
|
|
|
showTeamsInProg: true |
|
|
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
tournament.isCanceled = true |
|
|
|
|
@ -185,6 +188,8 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
assert(t.enableTimeToConfirm == tournament.enableTimeToConfirm) |
|
|
|
|
assert(t.isCorporateTournament == tournament.isCorporateTournament) |
|
|
|
|
assert(t.isTemplate == tournament.isTemplate) |
|
|
|
|
assert(t.publishProg == tournament.publishProg) |
|
|
|
|
assert(t.showTeamsInProg == tournament.showTeamsInProg) |
|
|
|
|
} else { |
|
|
|
|
XCTFail("missing data") |
|
|
|
|
} |
|
|
|
|
@ -198,7 +203,9 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let groupStage = GroupStage(tournament: tournamentId, index: 2, size: 3, format: MatchFormat.nineGames, startDate: Date(), name: "Yeah!", step: 1) |
|
|
|
|
let groupStage = GroupStage(tournament: tournamentId, index: 2, size: 3, format: MatchFormat.nineGames, startDate: Date(), name: "Yeah!", step: 1, |
|
|
|
|
plannedStartDate: Date() |
|
|
|
|
) |
|
|
|
|
groupStage.storeId = "123" |
|
|
|
|
if let gs: GroupStage = try await StoreCenter.main.service().post(groupStage) { |
|
|
|
|
|
|
|
|
|
@ -211,6 +218,8 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
assert(gs.matchFormat == groupStage.matchFormat) |
|
|
|
|
assert(gs.startDate != nil) |
|
|
|
|
assert(gs.step == groupStage.step) |
|
|
|
|
assert(r.plannedStartDate != nil) |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
XCTFail("missing data") |
|
|
|
|
} |
|
|
|
|
@ -227,7 +236,9 @@ 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(), groupStageLoserBracket: false, loserBracketMode: .manual) |
|
|
|
|
let round = Round(tournament: tournamentId, index: 1, parent: parentRoundId, matchFormat: MatchFormat.nineGames, startDate: Date(), groupStageLoserBracket: false, loserBracketMode: .manual, |
|
|
|
|
plannedStartDate: Date() |
|
|
|
|
) |
|
|
|
|
round.storeId = "abc" |
|
|
|
|
if let r: Round = try await StoreCenter.main.service().post(round) { |
|
|
|
|
|
|
|
|
|
@ -240,6 +251,7 @@ final class ServerDataTests: XCTestCase { |
|
|
|
|
assert(r.startDate != nil) |
|
|
|
|
assert(r.groupStageLoserBracket == round.groupStageLoserBracket) |
|
|
|
|
assert(r.loserBracketMode == round.loserBracketMode) |
|
|
|
|
assert(r.plannedStartDate != nil) |
|
|
|
|
} else { |
|
|
|
|
XCTFail("missing data") |
|
|
|
|
} |
|
|
|
|
|