Converter tests

This commit is contained in:
Marcin Kostrzewski 2020-10-29 11:37:07 +01:00
parent 26d06e96a8
commit cc3ddcdd4f

View File

@ -16,4 +16,21 @@ public class ProtocolMessageTest {
assertArrayEquals(msg, messageOut.getMessage(), "Message not right."); assertArrayEquals(msg, messageOut.getMessage(), "Message not right.");
} }
@Test
public void byteToIntIntToByteTest(){
int testedInt = 12512;
byte[] out = ProtocolMessage.intToByte(testedInt);
int result = ProtocolMessage.byteToInt(out);
assertEquals(testedInt, result, "Integers not equal!");
}
@Test
public void charToIntToCharTest(){
int testedInt = 12512;
char[] out = ProtocolMessage.intToCharArray(testedInt);
int result = ProtocolMessage.charArrayToInt(out);
assertEquals(testedInt, result, "Integers not equal!");
}
} }