-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeSafeTest.java
More file actions
34 lines (29 loc) · 820 Bytes
/
TypeSafeTest.java
File metadata and controls
34 lines (29 loc) · 820 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
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
/**
* @author LEO D PEN
* @date 2021/2/16
* @desc
*/
@DisplayName("TypeSafeTest")
class TypeSafeTest {
private TypeSafe ts1, ts2;
@Test
public void test_type_safe() throws IllegalArgumentException {
ts1 = TypeSafe.builder()
.ID(1)
.name("PF")
.PID(true)
.build();
assertEquals(1, ts1.ID());
assertThrows(IllegalArgumentException.class,
() -> {
ts2 = TypeSafe.builder()
.ID(1)
// .name("PF")
.PID(true)
.build();
} );
}
}