use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldHaveSameSizeAs_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] %n" + "Actual and expected should have same size but actual size is:%n" + " <2>%n" + "while expected is:%n" + " <4>%n" + "Actual was:%n" + "<['a', 'b']>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldHaveSameTime_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
Date actual = DateUtil.parseDatetime("2011-01-01T05:01:00");
Date expected = DateUtil.parseDatetime("2011-01-01T05:01:01");
String message = shouldHaveSameTime(actual, expected).create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting%n" + " <2011-01-01T05:01:00.000>%n" + "to have the same time as:%n" + " <2011-01-01T05:01:01.000>%n" + "but actual time is%n" + " <" + actual.getTime() + "L>%n" + "and expected was:%n" + " <" + expected.getTime() + "L>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldHaveSize_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] %nExpected size:<2> but was:<4> in:%n<['a', 'b']>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldHaveTime_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
Date date = DateUtil.parseDatetime("2011-01-01T05:01:00");
String message = shouldHaveTime(date, 123).create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting%n" + " <2011-01-01T05:01:00.000>%n" + "to have time:%n" + " <123L>%n" + "but was:%n" + " <" + date.getTime() + "L>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldMatchPattern_create_Test method should_create_error_message_escaping_percent.
@Test
public void should_create_error_message_escaping_percent() {
factory = shouldMatch("%%E", "fffff");
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n \"%%%%E\"%nto match pattern:%n \"fffff\""));
}
Aggregations