Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 3ab7096

Browse files
committed
Create PacketHeaderTest.java
1 parent 514a51c commit 3ab7096

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package de.kaleidox.test.vban.packet;
2+
3+
import de.kaleidox.vban.packet.VBANPacketHead;
4+
5+
import org.junit.Before;
6+
import org.junit.Test;
7+
8+
import static org.junit.Assert.assertEquals;
9+
10+
public class PacketHeaderTest {
11+
private VBANPacketHead.Factory headFactory;
12+
13+
@Before
14+
public void setUp() {
15+
headFactory = VBANPacketHead.defaultTextProtocolFactory();
16+
}
17+
18+
@Test
19+
public void testHeaderLayout() {
20+
byte[] bytes = headFactory.create().getBytes();
21+
22+
assertEquals(bytes[0], 'V');
23+
assertEquals(bytes[1], 'B');
24+
assertEquals(bytes[2], 'A');
25+
assertEquals(bytes[3], 'N');
26+
}
27+
28+
@Test
29+
public void testHeaderSize() {
30+
assertEquals(24, headFactory.create().getBytes().length);
31+
}
32+
}

0 commit comments

Comments
 (0)