Closed dachrisch closed 3 months ago
Wait, so does this mean it's no longer possible to access FlutterBluePlus statically? Every use of FlutterBluePlus needs to share an instance of FlutterBluePlusMockable?
Wait, so does this mean it's no longer possible to access FlutterBluePlus statically? Every use of FlutterBluePlus needs to share an instance of FlutterBluePlusMockable?
That's the idea. In order to make it accessible in testing, this is the way. As all calls to this class should be encapsulated in ScooterService, there should be no problem
The ScooterService now uses a mockable Service (with the same interface as the static service) so it is possible to write tests with programmatically added bluetooth devices. An example is given in [device_scanning_test.test] which uses custom builder to create bluetooth device mocks