コード例 #1
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");
 }
コード例 #2
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");
 }
コード例 #3
0
 @Test
 public final void should_fail_if_actual_does_not_contain_given_values() {
   thrown.expectAssertionError("<['Leia', 'Luke']> does not contain element(s):<['Han']>");
   assertions.contains("Han");
 }
コード例 #4
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);
 }
コード例 #5
0
 @Test
 public final void should_throw_error_if_expected_is_null() {
   thrown.expectNullPointerException("The given array should not be null");
   Object[] expected = null;
   assertions.contains(expected);
 }
コード例 #6
0
 @Test
 public final void should_pass_if_actual_contains_given_values() {
   assertions.contains("Leia", "Luke");
 }