- 授权协议: Apache
- 开发语言: Java
- 操作系统: Android
- 软件首页: https://github.com/esmasui/AndroidJUnit4
- 软件文档: https://github.com/esmasui/AndroidJUnit4
软件介绍
AndroidJUnit4 是一个让 JUnit 4 可以直接运行在 Android 设备上的开源工具。
示例代码:
public class HelloActivity extends ActivityUnitTestCase<MyActivity> {
/**
* For Eclipse with ADT
*/
public static junit.framework.Test suite() {
// Should use AndroidJUnit4TestAdapter for to running AndroidDependent
// TestCases.
return new AndroidJUnit4TestAdapter(HelloActivity.class);
}
public static class MyActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView view = new TextView(this);
view.setText("Hello, activity.");
view.setId(android.R.id.text1);
setContentView(view);
}
}
private Intent startIntent;
public HelloActivity() {
super(MyActivity.class);
}
@Override
@Before
public void setUp() throws Exception {
super.setUp();
startIntent = new Intent(Intent.ACTION_MAIN);
}
@Test
public void assertPreconditions() {
startActivity(startIntent, null, null);
assertNotNull(getActivity());
}
@Test
public void sayHello() {
startActivity(startIntent, null, null);
assertThat(((TextView) getActivity().findViewById(android.R.id.text1)).getText()
.toString(), equalTo("Hello, activity."));
}
}
Hit Refresh
Satya Nadella、Greg Shaw / HarperBusiness / 2017-9-26 / USD 20.37
Hit Refresh is about individual change, about the transformation happening inside of Microsoft and the technology that will soon impact all of our lives—the arrival of the most exciting and disruptive......一起来看看 《Hit Refresh》 这本书的介绍吧!
JS 压缩/解压工具
在线压缩/解压 JS 代码
随机密码生成器
多种字符组合密码
