Search in sources :

Example 11 with TestDescription

use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.

the class ShouldBeEqualIgnoringNewlineDifference_create_Test method should_create_error_message.

@Test
public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + "  <\"foo\">%n" + "to be equal to:%n" + "  <\"bar\">%n" + "ignoring newline differences ('\\r\\n' == '\\n')"));
}
Also used : TestDescription(org.assertj.core.internal.TestDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Example 12 with TestDescription

use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.

the class ShouldBeEqualIgnoringSeconds_create_Test method should_create_error_message_for_OffsetTime.

@Test
public void should_create_error_message_for_OffsetTime() {
    factory = shouldBeEqualIgnoringSeconds(OffsetTime.of(12, 0, 1, 0, ZoneOffset.UTC), OffsetTime.of(12, 0, 2, 0, ZoneOffset.UTC));
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + "  <12:00:01Z>%n" + "to have same hour and minute as:%n" + "  <12:00:02Z>%n" + "but had not."));
}
Also used : TestDescription(org.assertj.core.internal.TestDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Example 13 with TestDescription

use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.

the class ShouldBeEqualIgnoringSeconds_create_Test method should_create_error_message_for_LocalTime.

@Test
public void should_create_error_message_for_LocalTime() {
    factory = shouldBeEqualIgnoringSeconds(LocalTime.of(12, 0, 1), LocalTime.of(12, 0, 2));
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + "  <12:00:01>%n" + "to have same hour and minute as:%n" + "  <12:00:02>%n" + "but had not."));
}
Also used : TestDescription(org.assertj.core.internal.TestDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Example 14 with TestDescription

use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.

the class ShouldBeEqualIgnoringTimezone_create_Test method should_create_error_message_for_OffsetTime.

@Test
public void should_create_error_message_for_OffsetTime() {
    factory = shouldBeEqualIgnoringTimezone(OffsetTime.of(12, 0, 0, 0, UTC), OffsetTime.of(12, 0, 0, 0, MIN));
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + "  <12:00Z>%n" + "to have same time fields except timezone as:%n" + "  <12:00-18:00>%n" + "but had not."));
}
Also used : TestDescription(org.assertj.core.internal.TestDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Example 15 with TestDescription

use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.

the class ShouldBeEqualIgnoringTimezone_create_Test method should_create_error_message_for_OffsetDateTime.

@Test
public void should_create_error_message_for_OffsetDateTime() {
    factory = shouldBeEqualIgnoringTimezone(OffsetDateTime.of(2000, 5, 13, 12, 0, 0, 0, UTC), OffsetDateTime.of(2000, 5, 13, 12, 0, 0, 0, MIN));
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + "  <2000-05-13T12:00Z>%n" + "to have same time fields except timezone as:%n" + "  <2000-05-13T12:00-18:00>%n" + "but had not."));
}
Also used : TestDescription(org.assertj.core.internal.TestDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Aggregations

TestDescription (org.assertj.core.internal.TestDescription)126 Test (org.junit.Test)112 StandardRepresentation (org.assertj.core.presentation.StandardRepresentation)48 URI (java.net.URI)27 URL (java.net.URL)24 CompletableFuture (java.util.concurrent.CompletableFuture)9 Before (org.junit.Before)9 Description (org.assertj.core.description.Description)4 Path (java.nio.file.Path)2 EmptyTextDescription.emptyDescription (org.assertj.core.description.EmptyTextDescription.emptyDescription)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 AtomicStampedReference (java.util.concurrent.atomic.AtomicStampedReference)1 ShouldHaveToString.shouldHaveToString (org.assertj.core.error.ShouldHaveToString.shouldHaveToString)1 Representation (org.assertj.core.presentation.Representation)1 CaseInsensitiveStringComparator (org.assertj.core.util.CaseInsensitiveStringComparator)1