Search in sources :

Example 91 with TextDescription

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>"));
}
Also used : TextDescription(org.assertj.core.description.TextDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Example 92 with TextDescription

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]"));
}
Also used : TextDescription(org.assertj.core.description.TextDescription) Test(org.junit.Test)

Example 93 with TextDescription

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]"));
}
Also used : TextDescription(org.assertj.core.description.TextDescription) Test(org.junit.Test)

Example 94 with TextDescription

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);
}
Also used : TextDescription(org.assertj.core.description.TextDescription) Test(org.junit.Test)

Example 95 with TextDescription

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");
}
Also used : TextDescription(org.assertj.core.description.TextDescription) Test(org.junit.Test)

Aggregations

TextDescription (org.assertj.core.description.TextDescription)210 Test (org.junit.Test)210 StandardRepresentation (org.assertj.core.presentation.StandardRepresentation)157 ComparatorBasedComparisonStrategy (org.assertj.core.internal.ComparatorBasedComparisonStrategy)24 PredicateDescription (org.assertj.core.presentation.PredicateDescription)8 Jedi (org.assertj.core.test.Jedi)6 Path (java.nio.file.Path)4 Integer.toHexString (java.lang.Integer.toHexString)3 Date (java.util.Date)3 Description (org.assertj.core.description.Description)3 Difference (org.assertj.core.internal.DeepDifference.Difference)3 BaseTest (org.assertj.core.api.BaseTest)2 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 LongPredicate (java.util.function.LongPredicate)1 Predicate (java.util.function.Predicate)1 Collectors (java.util.stream.Collectors)1 LongStream (java.util.stream.LongStream)1