test(planning): complete test suite with Phase 11 edge cases
Implement comprehensive test infrastructure and all 124 tests across 11 phases: - Phase 0: Test infrastructure (fixtures, mocks, helpers) - Phases 1-10: Core planning engine tests (previously implemented) - Phase 11: Edge case omnibus (11 new tests) - Data edge cases: nil stadiums, malformed dates, invalid coordinates - Boundary conditions: driving limits, radius boundaries - Time zone cases: cross-timezone games, DST transitions Reorganize test structure under Planning/ directory with proper organization. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
87
SportsTimeTests/Helpers/TestConstants.swift
Normal file
87
SportsTimeTests/Helpers/TestConstants.swift
Normal file
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// TestConstants.swift
|
||||
// SportsTimeTests
|
||||
//
|
||||
// Constants used across test suites for consistent test configuration.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum TestConstants {
|
||||
// MARK: - Distance & Radius
|
||||
|
||||
/// Standard radius for "nearby" game filtering (miles)
|
||||
static let nearbyRadiusMiles: Double = 50.0
|
||||
|
||||
/// Meters per mile conversion
|
||||
static let metersPerMile: Double = 1609.344
|
||||
|
||||
/// Nearby radius in meters
|
||||
static var nearbyRadiusMeters: Double { nearbyRadiusMiles * metersPerMile }
|
||||
|
||||
// MARK: - Timeouts
|
||||
|
||||
/// Maximum time for performance/scale tests (5 minutes)
|
||||
static let performanceTimeout: TimeInterval = 300.0
|
||||
|
||||
/// Maximum time before a test is considered hung (30 seconds)
|
||||
static let hangTimeout: TimeInterval = 30.0
|
||||
|
||||
/// Standard async test timeout
|
||||
static let standardTimeout: TimeInterval = 10.0
|
||||
|
||||
// MARK: - Performance Baselines
|
||||
// These will be recorded after initial runs and updated
|
||||
|
||||
/// Baseline time for 500 games (to be determined)
|
||||
static var baseline500Games: TimeInterval = 0
|
||||
|
||||
/// Baseline time for 2000 games (to be determined)
|
||||
static var baseline2000Games: TimeInterval = 0
|
||||
|
||||
/// Baseline time for 10000 games (to be determined)
|
||||
static var baseline10000Games: TimeInterval = 0
|
||||
|
||||
// MARK: - Driving Constraints
|
||||
|
||||
/// Default max driving hours per day (single driver)
|
||||
static let defaultMaxDrivingHoursPerDay: Double = 8.0
|
||||
|
||||
/// Average driving speed (mph) for estimates
|
||||
static let averageDrivingSpeedMPH: Double = 60.0
|
||||
|
||||
/// Max days lookahead for game transitions
|
||||
static let maxDayLookahead: Int = 5
|
||||
|
||||
// MARK: - Brute Force Verification
|
||||
|
||||
/// Maximum number of stops for brute force verification
|
||||
static let bruteForceMaxStops: Int = 8
|
||||
|
||||
// MARK: - Test Data Sizes
|
||||
|
||||
enum DataSize: Int {
|
||||
case tiny = 5
|
||||
case small = 50
|
||||
case medium = 500
|
||||
case large = 2000
|
||||
case stress = 10000
|
||||
case extreme = 50000
|
||||
}
|
||||
|
||||
// MARK: - Geographic Constants
|
||||
|
||||
/// Earth radius in miles (for haversine)
|
||||
static let earthRadiusMiles: Double = 3958.8
|
||||
|
||||
/// Earth circumference in miles
|
||||
static let earthCircumferenceMiles: Double = 24901.0
|
||||
|
||||
// MARK: - Known Distances (for validation)
|
||||
|
||||
/// NYC to LA approximate distance in miles
|
||||
static let nycToLAMiles: Double = 2451.0
|
||||
|
||||
/// Distance tolerance percentage for validation
|
||||
static let distanceTolerancePercent: Double = 0.01 // 1%
|
||||
}
|
||||
Reference in New Issue
Block a user