Xamarin中的TestSuiteInstrumentation:类型为';Java.Lang.RuntimeException';被抛出

Xamarin中的TestSuiteInstrumentation:类型为';Java.Lang.RuntimeException';被抛出,xamarin,android-instrumentation,Xamarin,Android Instrumentation,我正在使用测试工具在模拟器上执行Android单元测试。我使用了Xamarin的TestSuiteInstrumentation类。我得到以下错误: 错误:java.lang.NullPointerException:尝试调用虚拟 方法“android.content.res.Resources” 空对象引用上的android.content.Context.getResources() 有人能帮我解决这个问题吗?经过分析,我发现,在Nunitlite TestSuiteActivity表单的“

我正在使用测试工具在模拟器上执行Android单元测试。我使用了Xamarin的
TestSuiteInstrumentation
类。我得到以下错误:

错误:java.lang.NullPointerException:尝试调用虚拟 方法“android.content.res.Resources” 空对象引用上的android.content.Context.getResources()


有人能帮我解决这个问题吗?

经过分析,我发现,在Nunitlite TestSuiteActivity表单的“MainActivity”中调用了.Init(),但我无法从“TestSuiteInstrumentation”的子类中调用相同的函数" . 所以测试用例在Nunitlite GUI中通过,在Instrumentation runner中失败。有人能给我指点迷津吗?经过分析,我发现,在Nunitlite TestSuiteActivity表单的“MainActivity”中,调用了.Init(),但我无法从“TestSuiteInstrumentation”的子类中调用相同的函数。所以测试用例在Nunitlite GUI中传递,在Instrumentation runner中失败。有人能给我指点迷津吗。。?