Add BooleanUtilsTest tests.

Add testXor_primitive_validInput_1items().
Add testXor_object_validInput_1items().
This commit is contained in:
Gary Gregory 2022-05-04 10:40:10 -04:00
parent 6fa0a17595
commit 4ef1e3db99
1 changed files with 27 additions and 1 deletions

View File

@ -807,7 +807,6 @@ public class BooleanUtilsTest {
assertTrue(
BooleanUtils.or(new boolean[] { false, true, true }),
"False result for (false, true, true)");
}
@Test
@ -824,6 +823,20 @@ public class BooleanUtilsTest {
public void testXor_object_nullInput() {
assertThrows(NullPointerException.class, () -> BooleanUtils.xor((Boolean[]) null));
}
@Test
public void testXor_object_validInput_1items() {
assertEquals(
true,
BooleanUtils.xor(new Boolean[] { Boolean.TRUE }).booleanValue(),
"true");
assertEquals(
false,
BooleanUtils.xor(new Boolean[] { Boolean.FALSE }).booleanValue(),
"false");
}
@Test
public void testXor_object_validInput_2items() {
assertEquals(
@ -943,6 +956,19 @@ public class BooleanUtilsTest {
assertThrows(NullPointerException.class, () -> BooleanUtils.xor((boolean[]) null));
}
@Test
public void testXor_primitive_validInput_1items() {
assertEquals(
true,
BooleanUtils.xor(new boolean[] { true }),
"true");
assertEquals(
false,
BooleanUtils.xor(new boolean[] { false }),
"false");
}
@Test
public void testXor_primitive_validInput_2items() {
assertEquals(