Stabilize unit and UI tests for SportsTime
This commit is contained in:
@@ -67,7 +67,7 @@ struct SportTests {
|
||||
|
||||
@Test("MLB: isInSeason returns true for months 3-10")
|
||||
func mlb_isInSeason_normalRange() {
|
||||
let calendar = Calendar.current
|
||||
let calendar = TestClock.calendar
|
||||
|
||||
// In season: March through October
|
||||
for month in 3...10 {
|
||||
@@ -86,7 +86,7 @@ struct SportTests {
|
||||
|
||||
@Test("NBA: isInSeason returns true for months 10-12 and 1-6 (wrap-around)")
|
||||
func nba_isInSeason_wrapAround() {
|
||||
let calendar = Calendar.current
|
||||
let calendar = TestClock.calendar
|
||||
|
||||
// In season: October through June (wraps)
|
||||
let inSeasonMonths = [10, 11, 12, 1, 2, 3, 4, 5, 6]
|
||||
@@ -104,7 +104,7 @@ struct SportTests {
|
||||
|
||||
@Test("NFL: isInSeason returns true for months 9-12 and 1-2 (wrap-around)")
|
||||
func nfl_isInSeason_wrapAround() {
|
||||
let calendar = Calendar.current
|
||||
let calendar = TestClock.calendar
|
||||
|
||||
// In season: September through February (wraps)
|
||||
let inSeasonMonths = [9, 10, 11, 12, 1, 2]
|
||||
@@ -124,7 +124,7 @@ struct SportTests {
|
||||
|
||||
@Test("isInSeason boundary: first and last day of season month")
|
||||
func isInSeason_boundaryDays() {
|
||||
let calendar = Calendar.current
|
||||
let calendar = TestClock.calendar
|
||||
|
||||
// MLB: First day of March (in season)
|
||||
let marchFirst = calendar.date(from: DateComponents(year: 2026, month: 3, day: 1))!
|
||||
|
||||
Reference in New Issue
Block a user