Open Raphzz opened 5 years ago
Hi! We are implementing Bluetooth scanning in our App, it's my first time using RxBluetoothKit and I am loving it!
I am having trouble writing my tests for our Bluetooth service:
protocol BluetoothScanServiceProtocol { func startScanForBluetoothDevices(with service: String) -> Observable<ScannedPeripheral> func stopScanningBluetoothDevices() }
How can I mock the ScannedPeripheral class? I won't have a real ScannedPeripheral on my tests of course
My mock class:
final class MockBluetoothService: BluetoothScanServiceProtocol { func startScanForBluetoothDevices(with service: String) -> Observable<ScannedPeripheral> { return Observable.just(ScannedPeripheral()) // I can't initialize ScannedPeripheral } func stopScanningBluetoothDevices() {} }
Hi! We are implementing Bluetooth scanning in our App, it's my first time using RxBluetoothKit and I am loving it!
I am having trouble writing my tests for our Bluetooth service:
How can I mock the ScannedPeripheral class? I won't have a real ScannedPeripheral on my tests of course
My mock class: