【发布时间】:2016-12-28 12:30:37
【问题描述】:
我正在为 Android 应用程序类编写测试用例。但我无法找到获取此类上下文的方法。下面是我的测试用例类。
public class SplashScreenActivityTest extends TestCase {
SplashScreenActivity splashScreenActivity;
Context context;
public void setUp() throws Exception {
super.setUp();
splashScreenActivity = new SplashScreenActivity();
}
public void testDeviceDetailsPost() throws Exception {
//I need to access a method here which requires context
}
}
我看了很多问题,但我无法理解他们的答案。
例如这个问题 Get context of test project in Android junit test case
【问题讨论】:
标签: java android android-testing testcase