我不知道如何测试,我正在按照教程.我正在尝试运行:
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");
} …Run Code Online (Sandbox Code Playgroud)