forked from leonardoanalista/java2word
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestUtilsTest.java
More file actions
38 lines (27 loc) · 817 Bytes
/
Copy pathTestUtilsTest.java
File metadata and controls
38 lines (27 loc) · 817 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
37
38
package word;
import junit.framework.Assert;
import org.junit.Test;
import word.utils.TestUtils;
public class TestUtilsTest extends Assert{
@Test
public void testRegex(){
assertNotNull(new TestUtils());
assertEquals(1, TestUtils.regexCount("leonardo", "leo"));
}
@Test
public void testRegexNotFound(){
assertEquals(0, TestUtils.regexCount("xxxxx xxxx", "leo"));
}
@Test(expected = IllegalArgumentException.class)
public void testRegexNull01(){
assertEquals(0, TestUtils.regexCount("xxxxxxxxx", null));
}
@Test(expected = IllegalArgumentException.class)
public void testRegexNull02(){
assertEquals(0, TestUtils.regexCount(null, "xxx"));
}
@Test(expected = IllegalArgumentException.class)
public void testRegexNull03(){
assertEquals(0, TestUtils.regexCount(null, null));
}
}