コード例 #1
0
 @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();
 }
コード例 #2
0
 @Test
 public void should_pass_if_actual_is_not_empty() {
   arrays.assertNotEmpty(someInfo(), array("Yoda"));
 }
コード例 #3
0
 @Test
 public void should_fail_if_actual_is_null() {
   thrown.expectAssertionError(actualIsNull());
   arrays.assertNotEmpty(someInfo(), null);
 }
コード例 #4
0
 @Before
 public void setUp() {
   failures = spy(new Failures());
   arrays = new ObjectArrays();
   arrays.failures = failures;
 }