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.
 
 
 
 

82 lines
2.0 KiB

//
// APITest.swift
// GMERemittanceTests
//
// Created by InKwon Devik Kim on 03/05/2019.
// Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
//
import XCTest
@testable import GME_Remit
class APITest: XCTestCase {
func testProductList(){
let service = RewardService()
let expt = expectation(description: "ProductList")
service.fetchProductList(success: {
print("success: \($0?.count ?? 0)")
expt.fulfill()
}, failure: {
print("Error: \($0.localizedDescription)")
expt.fulfill()
})
wait(for: [expt], timeout: 5.0)
}
func testFetchBankList(){
let service = AddAccountService()
let expt = expectation(description: "testFetchBankList")
service.fetchBankList(success: {
print("banks: \($0)")
expt.fulfill()
}){
print("error: \($0)")
expt.fulfill()
}
wait(for: [expt], timeout: 5.0)
}
func testRealName(){
let service = AddAccountService()
let expt = expectation(description: "testRealName")
var params = ["CustomerId": "85074"]
params["BankCode"] = "034"
params["AccountNumber"] = "1234512345"
service.verifyAccountService(params: params, success: {
expt.fulfill()
}) {
print("error: \($0)")
expt.fulfill()
}
wait(for: [expt], timeout: 5.0)
}
func testFetchOrderHistory() {
let service = OrderHistoryService()
let expt = expectation(description: "testFetchOrderHistory")
service.fetchOrderHistory(
from: "2019-05-01",
to: "2019-05-11",
success: {
print("response: \($0)")
expt.fulfill()
},
failure: {
print("error: \($0)")
expt.fulfill()
})
wait(for: [expt], timeout: 5.0)
}
func testFetchHotLines(){
let service = HomeService()
service.fetchHotLines()
}
}