Created
August 17, 2020 00:36
-
-
Save victorpanitz/b994e9d193d324fd8df8f39fa57d818d 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() { | |
URLSession.initSwizzle() | |
let sut = Network.shared | |
let taskLorem = URLSessionTaskSpy() | |
let taskIpsum = URLSessionTaskSpy() | |
FakeURLSession.tasksToBeReturned = [taskLorem, taskIpsum] | |
XCTAssertFalse(taskLorem.cancelCalled) | |
XCTAssertFalse(taskIpsum.cancelCalled) | |
sut.cancelAllTasks() | |
XCTAssertTrue(taskLorem.cancelCalled) | |
XCTAssertTrue(taskIpsum.cancelCalled) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment