Created
June 24, 2021 04:35
-
-
Save thanakijwanavit/22f2b233d58bbbf2c27f8bb8c9e1ea0b to your computer and use it in GitHub Desktop.
testAsyncSwift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
@testable import planyoBooking | |
import Alamofire | |
class TestResourcesApi: XCTestCase { | |
func testApiCall(){ | |
let exp = expectation(description: #function) | |
asyncDetached(priority: .none) { | |
let result:TestApi = await PlanyoApi.callApiGetAsync(method: "api_test", params: [:], resultClass: TestApi.self)! | |
XCTAssertEqual(result.data, "API Test Response") | |
exp.fulfill() | |
} | |
wait(for: [exp], timeout: 5) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment