Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Robolectric无法模拟LocalBroadcastManager_Android_Unit Testing_Localbroadcastmanager - Fatal编程技术网

Android Robolectric无法模拟LocalBroadcastManager

Android Robolectric无法模拟LocalBroadcastManager,android,unit-testing,localbroadcastmanager,Android,Unit Testing,Localbroadcastmanager,我在尝试测试使用LocalBroadcastManager的类时遇到上述错误。我正在使用Robolectric和Mockito来运行我的测试 你能建议我如何模仿这个LocalBroadcastManager,这样我就可以把我的测试变成绿色吗 以下是我的依赖项: at org.robolectric.shadows.support.v4. ShadowLocalBroadcastManager.shadowOf(ShadowLocalBroadcastManager.java:42) testC

我在尝试测试使用LocalBroadcastManager的类时遇到上述错误。我正在使用Robolectric和Mockito来运行我的测试

你能建议我如何模仿这个LocalBroadcastManager,这样我就可以把我的测试变成绿色吗

以下是我的依赖项:

at org.robolectric.shadows.support.v4.
ShadowLocalBroadcastManager.shadowOf(ShadowLocalBroadcastManager.java:42)
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.robolectric:robolectric:3.5'
testCompile 'org.robolectric:shadows-support-v4:3.0'
testCompile "org.robolectric:shadows-multidex:3.0"

androidTestCompile 'com.android.support:support-annotations:25.3.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'