Stabilize unit and UI tests for SportsTime
This commit is contained in:
@@ -22,7 +22,7 @@ struct ItineraryBuilderTests {
|
||||
private let chicagoCoord = CLLocationCoordinate2D(latitude: 41.8827, longitude: -87.6233)
|
||||
private let seattleCoord = CLLocationCoordinate2D(latitude: 47.5914, longitude: -122.3316)
|
||||
|
||||
private let calendar = Calendar.current
|
||||
private let calendar = TestClock.calendar
|
||||
|
||||
// MARK: - Specification Tests: build()
|
||||
|
||||
@@ -203,7 +203,7 @@ struct ItineraryBuilderTests {
|
||||
|
||||
@Test("arrivalBeforeGameStart: sufficient time passes")
|
||||
func arrivalBeforeGameStart_sufficientTime_passes() {
|
||||
let now = Date()
|
||||
let now = TestClock.now
|
||||
let tomorrow = calendar.date(byAdding: .day, value: 1, to: now)!
|
||||
let gameTime = calendar.date(bySettingHour: 19, minute: 0, second: 0, of: tomorrow)!
|
||||
|
||||
@@ -232,7 +232,7 @@ struct ItineraryBuilderTests {
|
||||
|
||||
@Test("arrivalBeforeGameStart: insufficient time fails")
|
||||
func arrivalBeforeGameStart_insufficientTime_fails() {
|
||||
let now = Date()
|
||||
let now = TestClock.now
|
||||
let gameTime = now.addingTimeInterval(2 * 3600) // Game in 2 hours
|
||||
|
||||
let stop1 = makeStop(
|
||||
@@ -349,7 +349,7 @@ struct ItineraryBuilderTests {
|
||||
private func makeStop(
|
||||
city: String,
|
||||
coordinate: CLLocationCoordinate2D?,
|
||||
departureDate: Date = Date(),
|
||||
departureDate: Date = TestClock.now,
|
||||
firstGameStart: Date? = nil
|
||||
) -> ItineraryStop {
|
||||
ItineraryStop(
|
||||
|
||||
Reference in New Issue
Block a user