File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Tests/AsyncLocationKitTests Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,21 @@ import CoreLocation
33@testable import AsyncLocationKit
44
55final class AsyncLocationKitTests : XCTestCase {
6- let locationManager = AsyncLocationManager ( locationManager: MockLocationManager ( ) , desiredAccuracy: . bestAccuracy)
6+ static let mockLocationManager = MockLocationManager ( )
7+
8+ func testDesiredAccuracy( ) {
9+ let firstAccuracy : LocationAccuracy = . nearestTenMetersAccuracy
10+ let locationManager = AsyncLocationManager ( locationManager: AsyncLocationKitTests . mockLocationManager, desiredAccuracy: firstAccuracy)
11+ XCTAssertTrue ( AsyncLocationKitTests . mockLocationManager. desiredAccuracy == firstAccuracy. convertingAccuracy)
12+
13+ let secondAccuracy : LocationAccuracy = . bestForNavigationAccuracy
14+ locationManager. updateAccuracy ( with: secondAccuracy)
15+ XCTAssertTrue ( AsyncLocationKitTests . mockLocationManager. desiredAccuracy == secondAccuracy. convertingAccuracy)
16+ }
717
818 func testRequestLocation( ) async {
919 do {
20+ let locationManager = AsyncLocationManager ( locationManager: AsyncLocationKitTests . mockLocationManager)
1021 let location = try await locationManager. requestLocation ( )
1122
1223 switch location {
You can’t perform that action at this time.
0 commit comments