pscbonline-ios/PSCBOnlineTests/Serializable/PKPaymentTokenTests.swift

36 lines
717 B
Swift
Raw Normal View History

2024-07-08 15:20:00 +03:00
//
// PKPaymentTokenTests.swift
// PSCB-OOS-iOSTests
//
// Created by Antonov Ilia on 22.10.2020.
//
#if canImport(PassKit)
import Foundation
import PassKit
import XCTest
@testable import PSCBOnline
final class PKPaymentTokenTests: XCTestCase {
func testToCryptogramString() {
// given:
let token = MockPaymentToken.createToken()
// expect: No exception is thrown on creating a string
XCTAssertNoThrow(try token.toCryptogramString())
// when:
let cryptogram = try! token.toCryptogramString()
print(">> Cryptogram string: \(cryptogram)")
// then:
XCTAssertFalse(cryptogram.isEmpty)
}
}
#endif