36 lines
717 B
Swift
36 lines
717 B
Swift
|
//
|
||
|
// 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
|