add missing variables in xctests

online_payment
Raz 7 months ago
parent 339efee333
commit 1143f51744
  1. 19
      PadelClubTests/ServerDataTests.swift
  2. 19
      PadelClubTests/UserDataTests.swift

@ -113,7 +113,8 @@ final class ServerDataTests: XCTestCase {
return 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, 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) 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
)
tournament.isCanceled = true tournament.isCanceled = true
tournament.payment = .subscriptionUnit tournament.payment = .subscriptionUnit
@ -176,6 +177,14 @@ final class ServerDataTests: XCTestCase {
assert(t.hideUmpirePhone == tournament.hideUmpirePhone) assert(t.hideUmpirePhone == tournament.hideUmpirePhone)
assert(t.disableRankingFederalRuling == tournament.disableRankingFederalRuling) assert(t.disableRankingFederalRuling == tournament.disableRankingFederalRuling)
assert(t.teamCountLimit == tournament.teamCountLimit) assert(t.teamCountLimit == tournament.teamCountLimit)
assert(t.enableOnlinePayment == tournament.enableOnlinePayment)
assert(t.onlinePaymentIsMandatory == tournament.onlinePaymentIsMandatory)
assert(t.enableOnlinePaymentRefund == tournament.enableOnlinePaymentRefund)
assert(t.refundDateLimit?.formatted() == tournament.refundDateLimit?.formatted())
assert(t.stripeAccountId == tournament.stripeAccountId)
assert(t.enableTimeToConfirm == tournament.enableTimeToConfirm)
assert(t.isCorporateTournament == tournament.isCorporateTournament)
assert(t.isTemplate == tournament.isTemplate)
} else { } else {
XCTFail("missing data") XCTFail("missing data")
} }
@ -289,7 +298,7 @@ final class ServerDataTests: XCTestCase {
return return
} }
let playerRegistration = PlayerRegistration(teamRegistration: teamRegistrationId, firstName: "juan", lastName: "lebron", licenceId: "123", rank: 11, paymentType: PlayerPaymentType.cash, sex: PlayerSexType.male, tournamentPlayed: 2, points: 33, clubName: "le club", ligueName: "la league", assimilation: "ass", phoneNumber: "123123", email: "email@email.com", birthdate: nil, computedRank: 222, source: PlayerRegistration.PlayerDataSource.frenchFederation, hasArrived: true) let playerRegistration = PlayerRegistration(teamRegistration: teamRegistrationId, firstName: "juan", lastName: "lebron", licenceId: "123", rank: 11, paymentType: PlayerPaymentType.cash, sex: PlayerSexType.male, tournamentPlayed: 2, points: 33, clubName: "le club", ligueName: "la league", assimilation: "ass", phoneNumber: "123123", email: "email@email.com", birthdate: nil, computedRank: 222, source: PlayerRegistration.PlayerDataSource.frenchFederation, hasArrived: true, coach: false, captain: false, registeredOnline: false, timeToConfirm: nil, registrationStatus: PlayerRegistration.RegistrationStatus.waiting, paymentId: nil)
playerRegistration.storeId = "123" playerRegistration.storeId = "123"
if let pr: PlayerRegistration = try await StoreCenter.main.service().post(playerRegistration) { if let pr: PlayerRegistration = try await StoreCenter.main.service().post(playerRegistration) {
@ -316,6 +325,12 @@ final class ServerDataTests: XCTestCase {
assert(pr.captain == playerRegistration.captain) assert(pr.captain == playerRegistration.captain)
assert(pr.coach == playerRegistration.coach) assert(pr.coach == playerRegistration.coach)
assert(pr.registeredOnline == playerRegistration.registeredOnline) assert(pr.registeredOnline == playerRegistration.registeredOnline)
assert(pr.captain == playerRegistration.captain)
assert(pr.coach == playerRegistration.coach)
assert(pr.registeredOnline == playerRegistration.registeredOnline)
assert(pr.timeToConfirm == playerRegistration.timeToConfirm)
assert(pr.registrationStatus == playerRegistration.registrationStatus)
assert(pr.paymentId == playerRegistration.paymentId)
} else { } else {
XCTFail("missing data") XCTFail("missing data")
} }

@ -64,6 +64,15 @@ final class UserDataTests: XCTestCase {
user.groupStageMatchFormatPreference = MatchFormat.twoSets user.groupStageMatchFormatPreference = MatchFormat.twoSets
user.loserBracketMatchFormatPreference = MatchFormat.twoSetsOfFourGames user.loserBracketMatchFormatPreference = MatchFormat.twoSetsOfFourGames
user.loserBracketMode = .manual user.loserBracketMode = .manual
user.disableRankingFederalRuling = false
user.deviceId = "device123"
user.agents = ["agent1", "agent2"]
user.userRole = 2
user.registrationPaymentMode = .disabled
user.umpireCustomMail = "umpire@example.com"
user.umpireCustomContact = "John Umpire"
user.umpireCustomPhone = "+33612345678"
user.hideUmpireMail = false
if let uu = try await StoreCenter.main.service().put(user) { if let uu = try await StoreCenter.main.service().put(user) {
assert(uu.summonsMessageBody == user.summonsMessageBody) assert(uu.summonsMessageBody == user.summonsMessageBody)
@ -77,6 +86,16 @@ final class UserDataTests: XCTestCase {
assert(uu.groupStageMatchFormatPreference == user.groupStageMatchFormatPreference) assert(uu.groupStageMatchFormatPreference == user.groupStageMatchFormatPreference)
assert(uu.loserBracketMatchFormatPreference == user.loserBracketMatchFormatPreference) assert(uu.loserBracketMatchFormatPreference == user.loserBracketMatchFormatPreference)
assert(uu.loserBracketMode == user.loserBracketMode) assert(uu.loserBracketMode == user.loserBracketMode)
assert(uu.disableRankingFederalRuling == user.disableRankingFederalRuling)
assert(uu.deviceId == user.deviceId)
assert(uu.agents == user.agents)
assert(uu.userRole == user.userRole)
assert(uu.registrationPaymentMode == user.registrationPaymentMode)
assert(uu.umpireCustomMail == user.umpireCustomMail)
assert(uu.umpireCustomContact == user.umpireCustomContact)
assert(uu.umpireCustomPhone == user.umpireCustomPhone)
assert(uu.hideUmpireMail == user.hideUmpireMail)
assert(uu.hideUmpirePhone == user.hideUmpirePhone)
} else { } else {
XCTFail("missing data") XCTFail("missing data")
} }

Loading…
Cancel
Save