Android方法......没有嘲笑

时间:2016-04-27 10:13:40

标签: android junit android-gradle android-instrumentation

您好我正在尝试进行仪器测试并且我一直收到此错误。

我尝试添加以下测试选项:

testOptions {
        unitTests.returnDefaultValues = true
    }

但我现在得到一个错误,说找不到Gradle DSL方法testOptions()。

我正在使用以下gradle插件:

  classpath 'com.android.tools.build:gradle:1.3.0'

这是我的简单测试用例

public class ExampleUnitTest extends InstrumentationTestCase {

    @Test
    public void addition_isCorrect() throws Exception {
        Context context = getInstrumentation().getContext();
        assertNotNull(context);
        assertEquals(4, 2 + 2);
    }
}

0 个答案:

没有答案
相关问题