@Test public void should_fail_if_actual_contains_given_values() { AssertionInfo info = someInfo(); byte[] expected = {6, 8, 20}; try { arrays.assertDoesNotContain(info, actual, expected); } catch (AssertionError e) { verify(failures).failure(info, shouldNotContain(actual, expected, set((byte) 6, (byte) 8))); return; } throw expectedAssertionErrorNotThrown(); }
@Test public void should_fail_if_actual_is_null() { thrown.expectAssertionError(actualIsNull()); arrays.assertDoesNotContain(someInfo(), null, array(8)); }
@Test public void should_throw_error_if_array_of_values_to_look_for_is_empty() { thrown.expectIllegalArgumentException(valuesToLookForIsEmpty()); arrays.assertDoesNotContain(someInfo(), actual, emptyArray()); }
@Test public void should_throw_error_if_array_of_values_to_look_for_is_null() { thrown.expectNullPointerException(valuesToLookForIsNull()); arrays.assertDoesNotContain(someInfo(), actual, null); }
@Test public void should_pass_if_actual_does_not_contain_given_values_even_if_duplicated() { arrays.assertDoesNotContain(someInfo(), actual, array(12, 12, 20)); }