Skip to content

Commit

Permalink
Fixed failed test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
shafqat-muneer committed Jan 23, 2024
1 parent 5fa028b commit 42112fd
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ final class CourseDateViewModelTests: XCTestCase {

let block2 = CourseDateBlock(
assignmentType: nil,
complete: nil,
complete: true,
date: Date.today,
dateType: "event",
description: "",
Expand All @@ -139,15 +139,15 @@ final class CourseDateViewModelTests: XCTestCase {
userTimezone: nil
)

let sortedDict = courseDates.sortedDateToCourseDateBlockDict
let sortedDict = courseDates.sortedStatusToDateToCourseDateBlockDict[.completed]

XCTAssertEqual(sortedDict.keys.sorted().first, Date.today)
XCTAssertEqual(sortedDict?.keys.sorted().first, Date.today)
}

func testMultipleBlocksForSameDate() {
let block1 = CourseDateBlock(
assignmentType: nil,
complete: nil,
complete: true,
date: Date.today,
dateType: "event",
description: "",
Expand All @@ -161,7 +161,7 @@ final class CourseDateViewModelTests: XCTestCase {

let block2 = CourseDateBlock(
assignmentType: nil,
complete: nil,
complete: true,
date: Date.today,
dateType: "event",
description: "",
Expand All @@ -186,8 +186,8 @@ final class CourseDateViewModelTests: XCTestCase {
userTimezone: nil
)

let sortedDict = courseDates.sortedDateToCourseDateBlockDict
XCTAssertEqual(sortedDict[block1.date]?.count, 2, "There should be two blocks for the given date.")
let sortedDict = courseDates.sortedStatusToDateToCourseDateBlockDict[.completed]
XCTAssertEqual(sortedDict?[block1.date]?.count, 2, "There should be two blocks for the given date.")
}

func testBlockStatusForAssignmentType() {
Expand Down

0 comments on commit 42112fd

Please sign in to comment.