-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mmroz/documetation-updates
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// CheckoutV3CardTests.swift | ||
// Afterpay | ||
// | ||
// Created by Mark Mroz on 2024-12-04. | ||
// Copyright © 2024 Afterpay. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import Afterpay | ||
|
||
final class CheckoutV3CardTests: XCTestCase { | ||
func testCardZeroPaddedExpiryMonth() { | ||
XCTAssertEqual(makeCard(expiryMonth: 1).zeroPaddedExpiryMonth, "01") | ||
XCTAssertEqual(makeCard(expiryMonth: 2).zeroPaddedExpiryMonth, "02") | ||
XCTAssertEqual(makeCard(expiryMonth: 3).zeroPaddedExpiryMonth, "03") | ||
XCTAssertEqual(makeCard(expiryMonth: 4).zeroPaddedExpiryMonth, "04") | ||
XCTAssertEqual(makeCard(expiryMonth: 5).zeroPaddedExpiryMonth, "05") | ||
XCTAssertEqual(makeCard(expiryMonth: 6).zeroPaddedExpiryMonth, "06") | ||
XCTAssertEqual(makeCard(expiryMonth: 7).zeroPaddedExpiryMonth, "07") | ||
XCTAssertEqual(makeCard(expiryMonth: 8).zeroPaddedExpiryMonth, "08") | ||
XCTAssertEqual(makeCard(expiryMonth: 9).zeroPaddedExpiryMonth, "09") | ||
XCTAssertEqual(makeCard(expiryMonth: 10).zeroPaddedExpiryMonth, "10") | ||
XCTAssertEqual(makeCard(expiryMonth: 11).zeroPaddedExpiryMonth, "11") | ||
XCTAssertEqual(makeCard(expiryMonth: 12).zeroPaddedExpiryMonth, "12") | ||
} | ||
|
||
// MARK: - Private | ||
|
||
private func makeCard(expiryMonth: Int) -> Card { | ||
Card(cardType: "Visa", cardNumber: "4242 4242 4242 4242", cvc: "222", expiryMonth: expiryMonth, expiryYear: 2024) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters