未收到测试事件 - Android Studio [英] Test events were not received - Android Studio

查看:45
本文介绍了未收到测试事件 - Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何测试,我正在学习教程.我正在尝试运行:

I have no idea how to test and I was following a tutorial.I am trying to run:

package name.company.sunshine.app.data;

import android.test.AndroidTestCase;

public class TestPractice extends AndroidTestCase {
     /*
       This gets run before every test.
     */
    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testThatDemonstratesAssertions() throws Throwable {
        int a = 5;
        int b = 3;
        int c = 5;
        int d = 10;

        assertEquals("X should be equal", a, c);
        assertTrue("Y should be true", d > a);
        assertFalse("Z should be false", a == b);

        if (b > d) {
            fail("XX should never happen");
        }
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }
}

但我在左下角的某个地方,在控制台未收到测试事件.我究竟做错了什么 ?我应该运行其他东西吗?

but I get somewhere in the bottom left corner, in the console Test events were not received. What am I doing wrong ? Should I run something else ?

推荐答案

运行测试时,选择 Android 测试选项.

When you run your test select the Android Test option.

JUnit 和 Gradle 选项不应用于此类测试.

The JUnit and Gradle options should not be used for this type of test.

这篇关于未收到测试事件 - Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆