use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeBefore_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(format("[Test] %n" + "Expecting:%n" + " <2011-01-01T00:00:00.000>%n" + "to be strictly before:%n" + " <2012-01-01T00:00:00.000>"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeBetween_create_Test method should_create_error_message_with_period_upper_boundary_included.
@Test
public void should_create_error_message_with_period_upper_boundary_included() {
ErrorMessageFactory factory = shouldBeBetween(parse("2010-01-01"), parse("2011-01-01"), parse("2012-01-01"), false, true);
String message = factory.create(new TextDescription("Test"));
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <2010-01-01T00:00:00.000>%n" + "to be in period:%n" + " ]2011-01-01T00:00:00.000, 2012-01-01T00:00:00.000]"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeBetween_create_Test method should_create_error_message_with_period_boundaries_included.
@Test
public void should_create_error_message_with_period_boundaries_included() {
ErrorMessageFactory factory = shouldBeBetween(parse("2010-01-01"), parse("2011-01-01"), parse("2012-01-01"), true, true);
String message = factory.create(new TextDescription("Test"));
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <2010-01-01T00:00:00.000>%n" + "to be in period:%n" + " [2011-01-01T00:00:00.000, 2012-01-01T00:00:00.000]"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class TextDescription_value_Test method should_return_value.
@Test
public void should_return_value() {
TextDescription description = new TextDescription("Robin");
assertThat(description.value()).isEqualTo(description.value);
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class TextDescription_value_Test method should_return_formatted_value.
@Test
public void should_return_formatted_value() {
TextDescription description = new TextDescription("Robin %s", "Hood");
assertThat(description.value()).isEqualTo("Robin Hood");
}
Aggregations