MockBluetoothServer
class MockBluetoothServer(initialStatus: ServerStatus = ServerStatus.AVAILABLE, setupMocks: Boolean = true) : BluetoothServer
A mock implementation of BluetoothServer. The status, isAdvertising and services flows are backed by MutableStateFlows the test can update directly, while the methods are mocked using the Kaluga mocking library so calls can be stubbed and verified.
Parameters
initialStatus
the initial ServerStatus
setupMocks
if true the mocks are configured with sensible default behaviour
Properties
Link copied to clipboard
val addMock: SuspendPairParametersMock<uuid: UUID, service: LocalService.DSL.Primary.() -> Unit, LocalService?>
Mock for add
Link copied to clipboard
Mock for advertise
Link copied to clipboard
Mock for close
Link copied to clipboard
Link copied to clipboard
The MutableStateFlow backing isAdvertising
Link copied to clipboard
Link copied to clipboard
Mock for remove
Link copied to clipboard
Link copied to clipboard
The MutableStateFlow backing services
Link copied to clipboard
Link copied to clipboard
The MutableStateFlow backing status
Link copied to clipboard
Mock for stopAdvertising
Functions
Link copied to clipboard
open suspend override fun add(uuid: UUID, service: LocalService.DSL.Primary.() -> Unit): LocalService?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard