mock

fun CentralManager.Factory.mock(environment: MockAndroidEnvironment = LatestApi(), scope: CoroutineScope): MockCentralManager

Creates a mock implementation of a CentralManager that can emulate scanning and connecting to Bluetooth Low Energy devices.

Use MockCentralManager.simulatePeripherals to set up mock peripherals and other methods from SimulationProvider to control the simulation.

Parameters

environment

The environment to use for the mock, defaults to the latest supported API.

scope

The coroutine scope.