         waitForExpectations()
     }
 
-    func testStopLocationUpdates() {
+    func testStopUpdatingLocation_WhenLocationIsUpdating_StopsUpdating() {
         CLLocationManagerMock._authorizationStatus = .authorizedAlways
         let expectation = self.expectation(description: "onSuccess fulfilled for future")
         let context = ImmediateContext()

        }
    }

    func testAuthorizedAlwaysWhenAuthorizedAlways() {
        CLLocationManagerMock._authorizationStatus = .authorizedAlways
        let expectation = self.expectation(description: "onSuccess fulfilled for future")
        let future = self.locationManager.authorize(.authorizedAlways)
        future.onSuccess {
            XCTAssertFalse(self.mock.requestAlwaysAuthorizationCalled, "requestAlwaysAuthorization called")
            expectation.fulfill()
        }
        future.onFailure{error in
            XCTAssert(false, "onFailure called")
        }
        waitForExpectations()
    }

    func testAuthorizedAlwaysSuccess() {
        CLLocationManagerMock._authorizationStatus = .notDetermined
        let expectation = self.expectation(description: "onSuccess fulfilled for future")
        let future = self.locationManager.authorize(.authorizedAlways)
        future.onSuccess {
            XCTAssert(self.mock.requestAlwaysAuthorizationCalled, "requestAlwaysAuthorization not called")
            expectation.fulfill()
        }
        future.onFailure{error in
            XCTAssert(false, "onFailure called")
        }
        self.locationManager.didChangeAuthorizationStatus(.authorizedAlways)
        waitForExpectations()
    }

    func testAuthorizedAlwaysFailure() {
        CLLocationManagerMock._authorizationStatus = .notDetermined
        let expectation = self.expectation(description: "onFailure fulfilled for future")
        let future = self.locationManager.authorize(.authorizedAlways)
        future.onSuccess {
            XCTAssert(false, "onSuccess called")
        }
        future.onFailure{error in
            XCTAssert(self.mock.requestAlwaysAuthorizationCalled, "requestAlwaysAuthorization not called")
            expectation.fulfill()
        }
        self.locationManager.didChangeAuthorizationStatus(.denied)
        waitForExpectations()
    }

    func testAuthorizedWhenInUseWhenAuthorizedWhenInUse() {
        CLLocationManagerMock._authorizationStatus = .authorizedWhenInUse
        let expectation = self.expectation(description: "onSuccess fulfilled for future")
        let future = self.locationManager.authorize(.authorizedWhenInUse)
        future.onSuccess {
            XCTAssertFalse(self.mock.requestWhenInUseAuthorizationCalled, "requestWhenInUseAuthorization called")
            expectation.fulfill()
        }
        future.onFailure{error in
            XCTAssert(false, "onFailure called")
        }
        waitForExpectations()
    }
    
    func testAuthorizedWhenInUseSuccess() {
        CLLocationManagerMock._authorizationStatus = .notDetermined
        let expectation = self.expectation(description: "onSuccess fulfilled for future")
        let future = self.locationManager.authorize(.authorizedWhenInUse)
        future.onSuccess {
            XCTAssert(self.mock.requestWhenInUseAuthorizationCalled, "requestWhenInUseAuthorization not called")
            expectation.fulfill()
        }
        future.onFailure{error in
            XCTAssert(false, "onFailure called")
        }
        self.locationManager.didChangeAuthorizationStatus(.authorizedWhenInUse)
        waitForExpectations()
    }
    
    func testAuthorizedWhenInUseFailure() {
        CLLocationManagerMock._authorizationStatus = .notDetermined
        let expectation = self.expectation(description: "onFailure fulfilled for future")
        let future = self.locationManager.authorize(.authorizedWhenInUse)
        future.onSuccess {
            XCTAssert(false, "onSuccess called")
        }
        future.onFailure{error in
            XCTAssert(self.mock.requestWhenInUseAuthorizationCalled, "requestWhenInUseAuthorization not called")
            XCTAssertEqual(error.code, FLError.authorizationWhenInUseFailed.code, "Error code invalid")
            expectation.fulfill()
        }
        locationManager.didChangeAuthorizationStatus(.denied)

        waitForExpectations()
    }
    
    func testStartMonitoringSignificantLocationChanges_WhenAuthorizedAlwaysAndUpdateSucceeds_CompletesSuccessfully() {
        CLLocationManagerMock._authorizationStatus = .authorizedAlways
        let expectation = self.expectation(description: "onFailure fulfilled for future")
        let context = ImmediateContext()
