Created
August 15, 2020 21:47
-
-
Save victorpanitz/69341da702fb0dbf440c62b9c75c7644 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 session = URLSessionSpy() | |
let sut = Network(session: session) | |
let loremTask = URLSessionDataTaskSpy() | |
let ipsumTask = URLSessionDataTaskSpy() | |
session.tasksToBeReturned = [loremTask, ipsumTask] | |
sut.cancelAllTasks() | |
XCTAssertEqual(ipsumTask.cancelCalled, true) | |
XCTAssertEqual(loremTask.cancelCalled, true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment