use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveMessageMatchingRegex_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
// GIVEN
String regex = "regex";
RuntimeException actual = new RuntimeException("error message");
// WHEN
String errorMessage = shouldHaveMessageMatchingRegex(actual, regex).create(new TestDescription("TEST"));
// THEN
assertThat(errorMessage).isEqualTo(format("[TEST] %n" + "Expecting message:%n" + " <\"error message\">%n" + "to match regex:%n" + " <\"regex\">%n" + "but did not."));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveNoParent_create_Test method setup.
@Before
public void setup() {
description = new TestDescription("Test");
representation = new StandardRepresentation();
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParent_create_Test method setup.
@Before
public void setup() {
description = new TestDescription("Test");
representation = new StandardRepresentation();
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveSameClass_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] %nExpecting%n <\"Yoda\">%nto have the same class as:%n <10L>(<java.lang.Long>) %nbut its class was:<java.lang.String>"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotHaveSameClass_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] %nExpecting:%n <\"Yoda\">%nnot to have not the same class as:%n <\"Luke\"> (java.lang.String)"));
}
Aggregations