Skip to content

Commit

Permalink
Merge pull request #738 from gini/fix_test_resolve_payment
Browse files Browse the repository at this point in the history
Fixed test for GiniBankAPiLibrary `resolvePayment`
  • Loading branch information
ValentinaIancu-Gini authored Nov 21, 2024
2 parents 2e1805e + d665905 commit 163263f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ class IntegrationTests: XCTestCase {
}

func testResolvePaymentRequest(){
let expect = expectation(description: "it resolves the payment request")
let message = "You can't resolve the previously resolved payment request"
let expect = expectation(description: message)

let paymentService = giniBankAPILib.paymentService()
paymentService.resolvePaymentRequest(id: paymentRequestID, recipient: "Dr. med. Hackler", iban: "DE13760700120500154000", bic: "", amount: "335.50:EUR", purpose: "ReNr AZ356789Z"){ result in
switch result {
case .success(let resolvedRequest):
XCTAssertEqual(resolvedRequest.links?.payment, "https://pay-api.gini.net/paymentRequests/a6466506-acf1-4896-94c8-9b398d4e0ee1/payment")
expect.fulfill()
XCTFail(message)
case .failure(let error):
XCTFail(String(describing: error))
expect.fulfill()
}
}
wait(for: [expect], timeout: 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ class PinningIntegrationTests: XCTestCase {
}

func testResolvePaymentRequest(){
let expect = expectation(description: "it resolves the payment request")
let message = "You can't resolve the previously resolved payment request"
let expect = expectation(description: message)

let paymentService = giniBankAPILib.paymentService()
paymentService.resolvePaymentRequest(id: paymentRequestID, recipient: "Dr. med. Hackler", iban: "DE13760700120500154000", bic: "", amount: "335.50:EUR", purpose: "ReNr AZ356789Z"){ result in
switch result {
case .success(let resolvedRequest):
XCTAssertEqual(resolvedRequest.links?.payment, "https://pay-api.gini.net/paymentRequests/a6466506-acf1-4896-94c8-9b398d4e0ee1/payment")
expect.fulfill()
case .failure(let error):
XCTFail(String(describing: error))
case .success(let resolvedRequest):
XCTFail(message)
case .failure(let error):
expect.fulfill()
}
}
wait(for: [expect], timeout: 10)
Expand Down

0 comments on commit 163263f

Please sign in to comment.