LocationSimulationRule

class LocationSimulationRule(iviServiceApiRule: IviServiceApiRule, initialLocationSimulationDataProvider: InitialLocationSimulationDataProvider?) : ResourceRule

Manages the simulated position during tests.

When an initial non-null LocationSimulationData is provided through the initialLocationSimulationDataProvider this position is simulated before starting the tests. The rule asserts when this is not possible.

It is only possible to simulate the position when:

During a test the simulated position can be changed by changing locationSimulationData.

Constructors

Link copied to clipboard
fun LocationSimulationRule(iviServiceApiRule: IviServiceApiRule, initialLocationSimulationDataProvider: InitialLocationSimulationDataProvider?)

Properties

Link copied to clipboard
var locationSimulationData: LocationSimulationData? = null

The simulated location.

Link copied to clipboard
val locationSimulationPossible: Boolean

true if location simulation is possible. If false, location simulation is not possible because the SUT is not configured with the LocationSimulationService or the mock_location permission is not granted.

Inherited functions

Link copied to clipboard
open override fun apply(baseStatement: Statement, description: Description): Statement