android - 基于 BLE 的 Android 应用的密封测试

标签 android mocking android-testing bluetooth-lowenergy

我在测试基于 BLE 的 android 应用程序时遇到问题。要执行测试,我必须高度依赖 BLE 设备。这会减慢整体开发时间并产生不稳定的测试。

我在谷歌上搜索找到任何示例来执行基于 BLE 的应用程序的密封测试。但到目前为止还没有成功。

这个问题有什么好的解决方案吗?是否有 BLE 的模拟库?

最佳答案

这取决于您用于 BLE 的库。我正在使用 this一种可以模拟 BLE 对象的方法。见 https://github.com/Polidea/RxAndroidBle#unit-tests

关于android - 基于 BLE 的 Android 应用的密封测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38436370/

相关文章:

java - 不兼容类型 : a protoClass cannot be converted to MessageOrBuilder

java - 使用外部 Https 主机进行 Spring Boot 测试的 WireMock

android - SQLiteCantOpenDatabaseException : unknown error (code 14): Could not open database (Only when unit testing the app)

android - 在 Android 中测试通知

Android P 非 SDK 接口(interface)限制适用于 android.support 和/或 androidx

android - 截取屏幕截图时更改小部件内容

android - 是否有适用于 iOS 和 Android 的 Xamarin.Form MediaPlayer?

java - 在实际方法中mockito并不模拟

python - 使用 patch decorator 和 side_effect 模拟文件读取

android - 库测试 : how to create a Context?