use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualWithTimePrecision_create_Test method should_create_error_message_ignoring_minutes.
@Test
public void should_create_error_message_ignoring_minutes() {
ErrorMessageFactory factory = shouldBeEqual(parseDatetimeWithMs("2011-01-01T05:00:00.000"), parseDatetimeWithMs("2011-01-01T06:05:17.003"), TimeUnit.MINUTES);
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %nExpecting:%n" + " <2011-01-01T05:00:00.000>%n" + "to have same year, month, day and hour as:%n" + " <2011-01-01T06:05:17.003>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeNullOrEmpty_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting null or empty but was:<[\"Luke\", \"Yoda\"]>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeSame_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <\"Luke\">%nand actual:%n <\"Yoda\">%nto refer to the same object"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeSortedAccordingToComparator_create_Test method should_create_error_message_with_comparator.
@Test
public void should_create_error_message_with_comparator() {
ErrorMessageFactory factory = shouldBeSortedAccordingToGivenComparator(1, array("b", "c", "A"), new CaseInsensitiveStringComparator());
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %ngroup is not sorted according to CaseInsensitiveStringComparator comparator because element 1:%n <\"c\">%nis not less or equal than element 2:%n <\"A\">%ngroup was:%n <[\"b\", \"c\", \"A\"]>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class BigDecimals_assertEqualByComparison_Test method should_fail_if_big_decimals_are_not_equal_by_comparison_whatever_custom_comparison_strategy_is.
@Test
public void should_fail_if_big_decimals_are_not_equal_by_comparison_whatever_custom_comparison_strategy_is() {
AssertionInfo info = someInfo();
try {
numbersWithAbsValueComparisonStrategy.assertEqualByComparison(info, TEN, ONE);
} catch (AssertionError e) {
verify(failures).failure(info, shouldBeEqual(TEN, ONE, absValueComparisonStrategy, new StandardRepresentation()));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
Aggregations