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.

54 lines
1.3 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. //
  2. // APITest.swift
  3. // GMERemittanceTests
  4. //
  5. // Created by InKwon Devik Kim on 03/05/2019.
  6. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import XCTest
  9. @testable import GME_Remit
  10. class APITest: XCTestCase {
  11. func testFecthRecipients() {
  12. let expt = expectation(description: "testFecthRecipients")
  13. let service = RecipientsService()
  14. service.fetchRecipients(
  15. success: {
  16. print($0.accounts?.count ?? 0)
  17. print($0.recipients?.count ?? 0)
  18. XCTAssert(true)
  19. expt.fulfill()
  20. },
  21. failure: {
  22. XCTAssert(false, $0.localizedDescription)
  23. expt.fulfill()
  24. }
  25. )
  26. wait(for: [expt], timeout: 1000.0)
  27. }
  28. func testLoadFormKYC() {
  29. let service = NewRegisterStep1Service()
  30. let expt = expectation(description: "testLoadFormKYC")
  31. server = .uat
  32. service.fetchInformation(
  33. success: {
  34. XCTAssert($0.cities?.count != 0 , "cities data is wrong")
  35. XCTAssert($0.idTypes?.count != 0 , "idTypes data is wrong")
  36. XCTAssert($0.branches?.count != 0 , "branches data is wrong")
  37. XCTAssert($0.banks?.count != 0 , "banks data is wrong")
  38. expt.fulfill()
  39. },
  40. failure: {
  41. XCTAssert(false, $0.localizedDescription)
  42. expt.fulfill()
  43. }
  44. )
  45. wait(for: [expt], timeout: 5.0)
  46. }
  47. }