Ejemplo n.º 1
0
  @Test
  public void testAnd_primitive_validInput_2items() {
    assertTrue("False result for (true, true)", BooleanUtils.and(new boolean[] {true, true}));

    assertTrue("True result for (false, false)", !BooleanUtils.and(new boolean[] {false, false}));

    assertTrue("True result for (true, false)", !BooleanUtils.and(new boolean[] {true, false}));

    assertTrue("True result for (false, true)", !BooleanUtils.and(new boolean[] {false, true}));
  }
Ejemplo n.º 2
0
  @Test
  public void testAnd_object_validInput_2items() {
    assertTrue(
        "False result for (true, true)",
        BooleanUtils.and(new Boolean[] {Boolean.TRUE, Boolean.TRUE}).booleanValue());

    assertTrue(
        "True result for (false, false)",
        !BooleanUtils.and(new Boolean[] {Boolean.FALSE, Boolean.FALSE}).booleanValue());

    assertTrue(
        "True result for (true, false)",
        !BooleanUtils.and(new Boolean[] {Boolean.TRUE, Boolean.FALSE}).booleanValue());

    assertTrue(
        "True result for (false, true)",
        !BooleanUtils.and(new Boolean[] {Boolean.FALSE, Boolean.TRUE}).booleanValue());
  }
Ejemplo n.º 3
0
 @Test(expected = IllegalArgumentException.class)
 public void testAnd_object_nullElementInput() {
   BooleanUtils.and(new Boolean[] {null});
 }
Ejemplo n.º 4
0
 @Test(expected = IllegalArgumentException.class)
 public void testAnd_object_nullInput() {
   BooleanUtils.and((Boolean[]) null);
 }
Ejemplo n.º 5
0
 @Test(expected = IllegalArgumentException.class)
 public void testAnd_primitive_emptyInput() {
   BooleanUtils.and(new boolean[] {});
 }