Stabilize unit and UI tests for SportsTime
This commit is contained in:
@@ -33,8 +33,8 @@ struct ScenarioCPlannerTests {
|
||||
startLocation: nil, // Missing
|
||||
endLocation: endLocation,
|
||||
sports: [.mlb],
|
||||
startDate: Date(),
|
||||
endDate: Date().addingTimeInterval(86400 * 7),
|
||||
startDate: TestClock.now,
|
||||
endDate: TestClock.now.addingTimeInterval(86400 * 7),
|
||||
leisureLevel: .moderate,
|
||||
lodgingType: .hotel,
|
||||
numberOfDrivers: 1
|
||||
@@ -67,8 +67,8 @@ struct ScenarioCPlannerTests {
|
||||
startLocation: startLocation,
|
||||
endLocation: nil, // Missing
|
||||
sports: [.mlb],
|
||||
startDate: Date(),
|
||||
endDate: Date().addingTimeInterval(86400 * 7),
|
||||
startDate: TestClock.now,
|
||||
endDate: TestClock.now.addingTimeInterval(86400 * 7),
|
||||
leisureLevel: .moderate,
|
||||
lodgingType: .hotel,
|
||||
numberOfDrivers: 1
|
||||
@@ -102,8 +102,8 @@ struct ScenarioCPlannerTests {
|
||||
startLocation: startLocation,
|
||||
endLocation: endLocation,
|
||||
sports: [.mlb],
|
||||
startDate: Date(),
|
||||
endDate: Date().addingTimeInterval(86400 * 7),
|
||||
startDate: TestClock.now,
|
||||
endDate: TestClock.now.addingTimeInterval(86400 * 7),
|
||||
leisureLevel: .moderate,
|
||||
lodgingType: .hotel,
|
||||
numberOfDrivers: 1
|
||||
@@ -139,8 +139,8 @@ struct ScenarioCPlannerTests {
|
||||
startLocation: startLocation,
|
||||
endLocation: endLocation,
|
||||
sports: [.mlb],
|
||||
startDate: Date(),
|
||||
endDate: Date().addingTimeInterval(86400 * 7),
|
||||
startDate: TestClock.now,
|
||||
endDate: TestClock.now.addingTimeInterval(86400 * 7),
|
||||
leisureLevel: .moderate,
|
||||
lodgingType: .hotel,
|
||||
numberOfDrivers: 1
|
||||
@@ -174,8 +174,8 @@ struct ScenarioCPlannerTests {
|
||||
startLocation: startLocation,
|
||||
endLocation: endLocation,
|
||||
sports: [.mlb],
|
||||
startDate: Date(),
|
||||
endDate: Date().addingTimeInterval(86400 * 7),
|
||||
startDate: TestClock.now,
|
||||
endDate: TestClock.now.addingTimeInterval(86400 * 7),
|
||||
leisureLevel: .moderate,
|
||||
lodgingType: .hotel,
|
||||
numberOfDrivers: 1
|
||||
@@ -199,7 +199,7 @@ struct ScenarioCPlannerTests {
|
||||
|
||||
@Test("plan: city names with state suffixes match stadium city names")
|
||||
func plan_cityNamesWithStateSuffixes_matchStadiumCities() {
|
||||
let baseDate = Date()
|
||||
let baseDate = TestClock.now
|
||||
let endDate = baseDate.addingTimeInterval(86400 * 10)
|
||||
|
||||
let startLocation = LocationInput(name: "Chicago, IL", coordinate: chicagoCoord)
|
||||
@@ -242,7 +242,7 @@ struct ScenarioCPlannerTests {
|
||||
|
||||
@Test("plan: directional filtering includes stadiums toward destination")
|
||||
func plan_directionalFiltering_includesCorrectStadiums() {
|
||||
let startDate = Date()
|
||||
let startDate = TestClock.now
|
||||
let endDate = startDate.addingTimeInterval(86400 * 14)
|
||||
|
||||
let startLocation = LocationInput(name: "Chicago", coordinate: chicagoCoord)
|
||||
@@ -297,7 +297,7 @@ struct ScenarioCPlannerTests {
|
||||
|
||||
@Test("plan: adds start and end as non-game stops")
|
||||
func plan_addsStartEndAsNonGameStops() {
|
||||
let startDate = Date()
|
||||
let startDate = TestClock.now
|
||||
let endDate = startDate.addingTimeInterval(86400 * 10)
|
||||
|
||||
let startLocation = LocationInput(name: "Chicago", coordinate: chicagoCoord)
|
||||
@@ -350,7 +350,7 @@ struct ScenarioCPlannerTests {
|
||||
|
||||
@Test("Invariant: start stop has no games")
|
||||
func invariant_startStopHasNoGames() {
|
||||
let startDate = Date()
|
||||
let startDate = TestClock.now
|
||||
let endDate = startDate.addingTimeInterval(86400 * 10)
|
||||
|
||||
let startLocation = LocationInput(name: "Chicago", coordinate: chicagoCoord)
|
||||
@@ -400,7 +400,7 @@ struct ScenarioCPlannerTests {
|
||||
|
||||
@Test("Invariant: end stop appears last")
|
||||
func invariant_endStopAppearsLast() {
|
||||
let startDate = Date()
|
||||
let startDate = TestClock.now
|
||||
let endDate = startDate.addingTimeInterval(86400 * 10)
|
||||
|
||||
let startLocation = LocationInput(name: "Chicago", coordinate: chicagoCoord)
|
||||
|
||||
Reference in New Issue
Block a user