Files
suixinkan_uikit/suixinkanTests/MockLocationProvider.swift
汉秋 cfcd3eee6f Integrate Amap SDK to replace CoreLocation and MapKit for all location features.
Unify GPS, reverse geocoding, and map display behind LocationProvider with privacy-gated bootstrap after login, aligned with Android.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:49:22 +08:00

31 lines
987 B
Swift

//
// MockLocationProvider.swift
// suixinkanTests
//
import CoreLocation
@testable import suixinkan
///
final class MockLocationProvider: LocationProviding, @unchecked Sendable {
var snapshot = HomeLocationSnapshot(latitude: 39.9087, longitude: 116.3975, address: "北京市东城区")
var coordinate = CLLocationCoordinate2D(latitude: 39.9087, longitude: 116.3975)
var reverseGeocodeResult = "北京市东城区"
var requestSnapshotError: Error?
var requestCoordinateError: Error?
func requestSnapshot() async throws -> HomeLocationSnapshot {
if let requestSnapshotError { throw requestSnapshotError }
return snapshot
}
func requestCoordinate() async throws -> CLLocationCoordinate2D {
if let requestCoordinateError { throw requestCoordinateError }
return coordinate
}
func reverseGeocode(latitude: Double, longitude: Double) async -> String {
reverseGeocodeResult
}
}