【发布时间】:2011-05-15 21:44:09
【问题描述】:
我正在 Android 中运行一个扩展 ActivityInstrumentationTestCase2 的 junit 测试。我正在使用它来启动一项活动。
活动使用应用程序对象的子类来获取一些参数。我从上下文中获取应用程序对象。
很遗憾,ActivityInstrumentationTestCase2 不提供对上下文的访问。有没有办法在获取活动之前访问上下文?
【问题讨论】:
标签: android unit-testing