Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LoginTests: XCTestCase {
- let viewControllerToTest = ViewController()
- func testLogin() {
- // Since this is an async call we need to wait for the callback in the test - otherwise we will not run long enought to get the response
- let loginExpectation = expectation(description: "should call login")
- viewController.login("testEmail", "testPassword", completion: { success in
- loginExpectation.fulfill()
- XCTAssertTrue(success)
- })
- wait(for: loginExpectation, timeout: 0.1)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement