Skip to content

Commit

Permalink
Add BooleanUtilsTest tests.
Browse files Browse the repository at this point in the history
Add testXor_primitive_validInput_1items().
Add testXor_object_validInput_1items().
  • Loading branch information
garydgregory committed May 4, 2022
1 parent 6fa0a17 commit 4ef1e3d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ public void testOr_primitive_validInput_3items() {
assertTrue(
BooleanUtils.or(new boolean[] { false, true, true }),
"False result for (false, true, true)");

}

@Test
Expand All @@ -824,6 +823,20 @@ public void testXor_object_nullElementInput() {
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(
Expand Down Expand Up @@ -943,6 +956,19 @@ public void testXor_primitive_nullInput() {
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(
Expand Down

0 comments on commit 4ef1e3d

Please sign in to comment.