philadelphia-core: Improve 'FIXValue#asBoolean' tests
Test both true and false.
@@ -134,24 +134,17 @@ class FIXValueTest {
}
@Test
- void get() {
- get("FOO\u0001");
-
- assertEquals("FOO\u0001", put());
- }
-
- @Test
- void asBoolean() {
+ void asBooleanTrue() {
get("Y\u0001");
assertTrue(value.asBoolean());
}
@Test
- void setBoolean() {
- value.setBoolean(false);
+ void asBooleanFalse() {
+ get("N\u0001");
- assertEquals("N\u0001", put());
+ assertFalse(value.asBoolean());
}
@Test
@@ -161,6 +154,13 @@ class FIXValueTest {
assertThrows(FIXValueFormatException.class, () -> value.asBoolean());
}
+ @Test
+ void setBoolean() {
+ value.setBoolean(false);
+
+ assertEquals("N\u0001", put());
+ }
+
@Test
void asChar() {
get("Y\u0001");
@@ -464,6 +464,13 @@ class FIXValueTest {
assertThrows(FIXValueFormatException.class, () -> value.asCheckSum());
}
+ @Test
+ void get() {
+ get("FOO\u0001");
+
+ assertEquals("FOO\u0001", put());
+ }
+
@Test
void readOverflow() {
assertThrows(FIXValueOverflowException.class, () -> value.get(ByteBuffers.wrap("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")));
