You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
//
|
|
// PaymentTests.swift
|
|
// PadelClubTests
|
|
//
|
|
// Created by Laurent Morvillier on 01/05/2024.
|
|
//
|
|
|
|
import XCTest
|
|
@testable import PadelClub
|
|
|
|
final class PaymentTests: XCTestCase {
|
|
|
|
override func setUpWithError() throws {
|
|
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
}
|
|
|
|
override func tearDownWithError() throws {
|
|
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
}
|
|
|
|
func testPayments() throws {
|
|
|
|
let tournament = Tournament.fake()
|
|
tournament.setPayment(.free)
|
|
assert(tournament.decryptPayment() == .free)
|
|
tournament.setPayment(.subscriptionUnit)
|
|
assert(tournament.decryptPayment() == .subscriptionUnit)
|
|
tournament.setPayment(.unit)
|
|
assert(tournament.decryptPayment() == .unit)
|
|
tournament.setPayment(.unlimited)
|
|
assert(tournament.decryptPayment() == .unlimited)
|
|
|
|
}
|
|
|
|
func testCanceled() throws {
|
|
|
|
let tournament = Tournament.fake()
|
|
|
|
tournament.setCanceled(true)
|
|
assert(tournament.decryptCanceled() == true)
|
|
tournament.setCanceled(false)
|
|
assert(tournament.decryptCanceled() == false)
|
|
|
|
}
|
|
|
|
}
|
|
|