forked from baiiu/AndroidModule
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalInstrumentedUnitTest.java
More file actions
45 lines (38 loc) · 1.46 KB
/
Copy pathLocalInstrumentedUnitTest.java
File metadata and controls
45 lines (38 loc) · 1.46 KB
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
37
38
39
40
41
42
43
44
45
package com.example.testing.testingexample;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* author: baiiu
* date: on 16/4/28 11:39
* description:
* CommonUtil中一部分依赖framework,在此处测.
* <br />
* Small: this test doesn't interact with any file system or network.
* Medium: Accesses file systems on box which is running tests.
* Large: Accesses external file systems, networks, etc.
* <br />
* see more:
* http://stackoverflow.com/questions/4671923/what-is-the-purpose-of-smalltest-mediumtest-and-largetest-annotations-in-an
*/
@RunWith(AndroidJUnit4.class) @SmallTest public class LocalInstrumentedUnitTest {
@Before public void setUp() throws Exception {
}
@Test public void testIsStringEmpty() throws Exception {
assertTrue(CommonUtil.isEmpty(""));
assertTrue(CommonUtil.isEmpty(" "));
}
@Test public void testIsAllStringEmpty() throws Exception {
assertTrue(CommonUtil.isAllEmpty("", " ", ""));
assertFalse(CommonUtil.isAllEmpty("哈哈哈", " "));
}
@Test public void testIsOneStringEmpty() throws Exception {
assertTrue(CommonUtil.isOneEmpty("", " ", ""));
assertTrue(CommonUtil.isOneEmpty("", "哈哈", " "));
assertFalse(CommonUtil.isOneEmpty("哈哈", "哈哈"));
}
}