@Test public void should_fail_if_actual_is_empty() { AssertionInfo info = someInfo(); try { arrays.assertNotEmpty(info, emptyArray()); } catch (AssertionError e) { verify(failures).failure(info, shouldNotBeEmpty()); return; } failBecauseExpectedAssertionErrorWasNotThrown(); }
@Test public void should_pass_if_actual_is_not_empty() { arrays.assertNotEmpty(someInfo(), array("Yoda")); }
@Test public void should_fail_if_actual_is_null() { thrown.expectAssertionError(actualIsNull()); arrays.assertNotEmpty(someInfo(), null); }
@Before public void setUp() { failures = spy(new Failures()); arrays = new ObjectArrays(); arrays.failures = failures; }