Last active
August 15, 2020 21:01
-
-
Save victorpanitz/2326399a746a0ee8d3f93ad2871f71f7 to your computer and use it in GitHub Desktop.
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
func test_cancellAllTasks_givenExistsActiveTasks_shouldCancellAllOfThem() { | |
... | |
let cancelTasksExpectation = XCTestExpectation(description: "cancelTasksExpectation") | |
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { | |
sut.session.getAllTasks { tasks in | |
activeTasksCount = tasks.count | |
cancelTasksExpectation.fulfill() | |
} | |
} | |
wait(for: [cancelTasksExpectation], timeout: 0.2) | |
XCTAssertEqual(activeTasksCount, 0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment