Search in sources :

Example 1 with BDDSoftAssertions

use of org.assertj.core.api.BDDSoftAssertions in project assertj-core by joel-costigliola.

the class BDDSoftAssertionsLineNumberTest method should_print_line_numbers_of_failed_assertions.

@Test
public void should_print_line_numbers_of_failed_assertions() {
    BDDSoftAssertions softly = new BDDSoftAssertions();
    try {
        softly.then(1).isLessThan(0).isLessThan(1);
        softly.assertAll();
        fail("Should not reach here");
    } catch (SoftAssertionError e) {
        assertThat(e).hasMessageContaining(format("1) %n" + "Expecting:%n" + " <1>%n" + "to be less than:%n" + " <0> %n" + "at BDDSoftAssertionsLineNumberTest.should_print_line_numbers_of_failed_assertions(BDDSoftAssertionsLineNumberTest.java:34)%n" + "2) %n" + "Expecting:%n" + " <1>%n" + "to be less than:%n" + " <1> %n" + "at BDDSoftAssertionsLineNumberTest.should_print_line_numbers_of_failed_assertions(BDDSoftAssertionsLineNumberTest.java:35)"));
    }
}
Also used : BDDSoftAssertions(org.assertj.core.api.BDDSoftAssertions) SoftAssertionError(org.assertj.core.api.SoftAssertionError) Test(org.junit.Test)

Aggregations

BDDSoftAssertions (org.assertj.core.api.BDDSoftAssertions)1 SoftAssertionError (org.assertj.core.api.SoftAssertionError)1 Test (org.junit.Test)1