Last active
May 20, 2022 10:29
-
-
Save tifoaudii/9e1c08ce31adf40fdbc284aae7a80f25 to your computer and use it in GitHub Desktop.
This file contains 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_whenContentTypeIsTodayTask_shouldFetchTodayTask() { | |
let dataStore = TaskViewDataStoreSpy() | |
let sut = TaskViewDefaultPresenter(dataStore: dataStore) | |
let contentType = TaskContentType.today | |
var presentableTask: PresentableTask? | |
sut.updateContentType(with: contentType) | |
sut.fetchTask(for: contentType) { tasks in | |
XCTAssertEqual(tasks.count, 1) | |
presentableTask = tasks.first! | |
} | |
dataStore.todayTaskCompletion?([ | |
TaskModel(title: "Today Task", type: "Urgent", deadline: Date(), color: TaskColorType.blue.color, isCompleted: false) | |
]) | |
XCTAssertTrue(dataStore.fetchTodayTaskCalled) | |
presentableTask?.selection() | |
XCTAssertTrue(dataStore.finishTaskCalled) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment