forked from Blankj/AndroidUtilCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestUtils.java
More file actions
36 lines (28 loc) · 956 Bytes
/
TestUtils.java
File metadata and controls
36 lines (28 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.blankj.utilcode.utils;
import android.content.Context;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
import java.io.File;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2016/8/21
* desc : 单元测试工具类
* </pre>
*/
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class TestUtils {
private TestUtils() {
throw new UnsupportedOperationException("u can't fuck me...");
}
public static final char SEP = File.separatorChar;
public static final String BASEPATH = System.getProperty("user.dir")
+ SEP + "src" + SEP + "test" + SEP + "res" + SEP;
public static Context getContext() {
return ShadowApplication.getInstance().getApplicationContext();
}
}