@Test public void testXor_primitive_validInput_2items() { assertTrue("True result for (true, true)", !BooleanUtils.xor(new boolean[] {true, true})); assertTrue("True result for (false, false)", !BooleanUtils.xor(new boolean[] {false, false})); assertTrue("False result for (true, false)", BooleanUtils.xor(new boolean[] {true, false})); assertTrue("False result for (false, true)", BooleanUtils.xor(new boolean[] {false, true})); }
@Test public void testXor_object_validInput_2items() { assertTrue( "True result for (true, true)", !BooleanUtils.xor(new Boolean[] {Boolean.TRUE, Boolean.TRUE}).booleanValue()); assertTrue( "True result for (false, false)", !BooleanUtils.xor(new Boolean[] {Boolean.FALSE, Boolean.FALSE}).booleanValue()); assertTrue( "False result for (true, false)", BooleanUtils.xor(new Boolean[] {Boolean.TRUE, Boolean.FALSE}).booleanValue()); assertTrue( "False result for (false, true)", BooleanUtils.xor(new Boolean[] {Boolean.FALSE, Boolean.TRUE}).booleanValue()); }
@Test(expected = IllegalArgumentException.class) public void testXor_object_nullElementInput() { BooleanUtils.xor(new Boolean[] {null}); }
@Test(expected = IllegalArgumentException.class) public void testXor_object_nullInput() { BooleanUtils.xor((Boolean[]) null); }
@Test(expected = IllegalArgumentException.class) public void testXor_primitive_emptyInput() { BooleanUtils.xor(new boolean[] {}); }