我是新来的Android仪表案件。我一直在寻找的API样本,发现有时候我们使用ActivityUnitTestCase和ActivityInstrumentationTestCase2。两者之间的区别是什么?什么时候我们使用一个比其他?
I am new to Android Instrumentation cases. i have been looking at the API samples and see that sometimes we use ActivityUnitTestCase and the ActivityInstrumentationTestCase2. What is the difference between the two ? When would we use one over the other ?
请参阅这里讨论的区别: http://www.vogella.com/articles/AndroidTesting/article.html#activity_testing
See the difference discussed here: http://www.vogella.com/articles/AndroidTesting/article.html#activity_testing
要点:
ActivityUnitTestCase可用于测试布局和分离的方法。 ActivityInstrumentationTestCase2可以在需要时发送触摸/鼠标事件,并测试状态管理使用。上一篇:恒“运行Android林特'失败,NullPointerException异常突然出现在Eclipse中(但似乎并没有成为我的code)我的、并没有、出现在、异常
下一篇:KeyEvent.ACTION_UP解雇两次ACTION_MEDIA_BUTTON两次、KeyEvent、ACTION_UP、ACTION_MEDIA_BUTTON