测试活动并没有收到 - 机器人工作室 [英] Test events were not received - Android Studio

查看:615
本文介绍了测试活动并没有收到 - 机器人工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何测试,我是跟随tutorial.I正在尝试运行:

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和摇篮的选择不应该使用这种类型的测试。

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

这篇关于测试活动并没有收到 - 机器人工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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