Skip to content

Commit f55513e

Browse files
committed
test: more ut
1 parent 28aeac5 commit f55513e

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.dfocus.enums;
2+
3+
import org.junit.Assert;
4+
import org.junit.Test;
5+
6+
public class AuthCodeTest {
7+
@Test
8+
public void equals() {
9+
Assert.assertTrue(AuthCode.AUTH_SUCCESS.equals("auth_success"));
10+
Assert.assertTrue(AuthCode.AUTH_FAILED.equals("auth_fail"));
11+
}
12+
13+
@Test
14+
public void from() {
15+
Assert.assertEquals(AuthCode.from("auth_success"), AuthCode.AUTH_SUCCESS);
16+
Assert.assertEquals(AuthCode.from("auth_fail"), AuthCode.AUTH_FAILED);
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.dfocus.enums;
2+
3+
import org.junit.Assert;
4+
import org.junit.Test;
5+
6+
public class BizEventTest {
7+
@Test
8+
public void equals() {
9+
Assert.assertTrue(BizEvent.AUTH.equals("auth"));
10+
Assert.assertTrue(BizEvent.SUBSCRIBE.equals("subscribe"));
11+
}
12+
13+
@Test
14+
public void from() {
15+
Assert.assertEquals(BizEvent.from("auth"), BizEvent.AUTH);
16+
Assert.assertEquals(BizEvent.from("subscribe"), BizEvent.SUBSCRIBE);
17+
}
18+
}

src/test/java/com/dfocus/enums/ClientStateTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ public class ClientStateTest {
77
@Test
88
public void equals() {
99
Assert.assertTrue(ClientState.CONNECTED.equals("connected"));
10+
Assert.assertTrue(ClientState.CONNECTING.equals("connecting"));
11+
Assert.assertTrue(ClientState.DISCONNECTED.equals("disconnected"));
1012
}
1113

1214
@Test
1315
public void from() {
1416
Assert.assertEquals(ClientState.from("connected"), ClientState.CONNECTED);
17+
Assert.assertEquals(ClientState.from("connecting"), ClientState.CONNECTING);
18+
Assert.assertEquals(ClientState.from("disconnected"), ClientState.DISCONNECTED);
1519
}
1620
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.dfocus.enums;
2+
3+
import org.junit.Assert;
4+
import org.junit.Test;
5+
6+
public class SubscribeCodeTest {
7+
@Test
8+
public void equals() {
9+
Assert.assertTrue(SubscribeCode.SUB_SUCCESS.equals("sub_success"));
10+
Assert.assertTrue(SubscribeCode.SUB_FAILED.equals("sub_fail"));
11+
}
12+
13+
@Test
14+
public void from() {
15+
Assert.assertEquals(SubscribeCode.from("sub_success"), SubscribeCode.SUB_SUCCESS);
16+
Assert.assertEquals(SubscribeCode.from("sub_fail"), SubscribeCode.SUB_FAILED);
17+
}
18+
}

0 commit comments

Comments
 (0)