use of com.solinia.solinia.Models.PacketCastingPercent in project solinia3-core by mixxit.
the class PacketCastingPercentTest method IfMissingSeperatorsThrowInvalidPacket.
@Test
public void IfMissingSeperatorsThrowInvalidPacket() {
String expectedException = "Packet data is wrong format";
String actualException = "";
try {
new PacketCastingPercent().fromPacketData("moo");
} catch (InvalidPacketException e) {
actualException = e.getMessage();
}
assertEquals(expectedException, actualException);
}
use of com.solinia.solinia.Models.PacketCastingPercent in project solinia3-core by mixxit.
the class PacketCastingPercentTest method IfMissingNullThrowInvalidPacket.
@Test
public void IfMissingNullThrowInvalidPacket() {
String expectedException = "Packet data is empty";
String actualException = "";
try {
new PacketCastingPercent().fromPacketData(null);
} catch (InvalidPacketException e) {
actualException = e.getMessage();
}
assertEquals(expectedException, actualException);
}
use of com.solinia.solinia.Models.PacketCastingPercent in project solinia3-core by mixxit.
the class PacketCastingPercentTest method WhenGivenPacketDataReturnExpectedFormat.
@Test
public void WhenGivenPacketDataReturnExpectedFormat() {
String testForPacketData = "1.0^";
String foundPacketData = "";
try {
PacketCastingPercent vitals = new PacketCastingPercent();
vitals.fromPacketData(testForPacketData);
foundPacketData = vitals.toPacketData();
} catch (InvalidPacketException e) {
e.printStackTrace();
}
assertEquals(testForPacketData, foundPacketData);
}
Aggregations