コード例 #1
0
 @Test
 public final void should_fail_and_display_description_if_actual_does_not_contain_given_values() {
   thrown.expectAssertionError(
       "[A Test] <['Leia', 'Luke']> does not contain element(s):<['Han']>");
   assertions.as("A Test").contains("Han");
 }
コード例 #2
0
 @Test
 public final void
     should_fail_with_custom_message_ignoring_description_if_actual_does_not_contain_given_values() {
   thrown.expectAssertionError("My custom message");
   assertions.as("A Test").overridingErrorMessage("My custom message").contains("Han");
 }
コード例 #3
0
 @Test
 public final void should_throw_error_and_display_description_if_expected_is_null() {
   thrown.expectNullPointerException("[A Test] The given array should not be null");
   Object[] expected = null;
   assertions.as("A Test").contains(expected);
 }