@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"); }
@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"); }
@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"); }
@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); }
@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); }
@Test public final void should_pass_if_actual_contains_given_values() { assertions.contains("Leia", "Luke"); }