use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotBeEqualNormalizingWhitespace_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(String.format("[Test] %n" + "Expecting:%n" + " <\" my\tfoo bar \">%n" + "not to be equal to:%n" + " <\" my foo bar \">%n" + "after whitespace differences are normalized"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotBeEqualWithinOffset_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
// GIVEN
ErrorMessageFactory factory = shouldNotBeEqual(8f, 6f, offset(5f), 2f);
// WHEN
String message = factory.create(new TestDescription("Test"), STANDARD_REPRESENTATION);
// THEN
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <8.0f>%n" + "not to be close to:%n" + " <6.0f>%n" + "by less than <5.0f> but difference was <2.0f>.%n" + "(a difference of exactly <5.0f> being considered invalid)"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotBeEqualWithinOffset_create_Test method should_create_error_message_for_strict_offset.
@Test
public void should_create_error_message_for_strict_offset() {
// GIVEN
ErrorMessageFactory factory = shouldNotBeEqual(8f, 6f, byLessThan(5f), 2f);
// WHEN
String message = factory.create(new TestDescription("Test"), STANDARD_REPRESENTATION);
// THEN
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <8.0f>%n" + "not to be close to:%n" + " <6.0f>%n" + "by less than <5.0f> but difference was <2.0f>.%n" + "(a difference of exactly <5.0f> being considered valid)"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldBeCancelled_create_Test method should_create_error_message.
@Test
public void should_create_error_message() throws Exception {
String error = shouldBeCancelled(new CompletableFuture<>()).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting%n" + " <CompletableFuture[Incomplete]>%n" + "to be cancelled.%n%s", WARNING));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldBeCompleted_create_Test method should_create_error_message.
@Test
public void should_create_error_message() throws Exception {
String error = shouldBeCompleted(new CompletableFuture<>()).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting%n" + " <CompletableFuture[Incomplete]>%n" + "to be completed.%n%s", WARNING));
}
Aggregations