use of org.assertj.core.description.Description in project assertj-core by joel-costigliola.
the class ListAssert_raw_list_assertions_chained_after_superclass_method_Test method raw_list_assertions_mixed_with_inherited_methods.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Ignore
@Test
public void raw_list_assertions_mixed_with_inherited_methods() {
Description description = emptyDescription();
List list = new java.util.ArrayList<>();
list.add("Key1");
list.add("Key2");
assertThat(list).as("desc").containsOnly("Key1", "Key2");
// try all base assertions followed by list specific ones using generics
assertThat(list).as("desc").usingDefaultComparator().isSorted().as(description).isSorted().describedAs(description).describedAs("describedAs").has(null).hasSameClassAs(list).hasToString(list.toString()).is(null).isEqualTo(list).isExactlyInstanceOf(Map.class).isIn(new ArrayList<>()).isIn(Map.class).isInstanceOf(Map.class).isInstanceOfAny(Map.class, String.class).isNot(null).isNotEqualTo(null).isNotEmpty().isNotExactlyInstanceOf(String.class).isNotIn(new ArrayList<>()).isNotIn(Map.class).isNotInstanceOf(Map.class).isNotInstanceOfAny(Map.class, String.class).isNotNull().isNotOfAnyClassIn(Map.class, String.class).isNotSameAs(null).isOfAnyClassIn(Map.class, String.class).isSameAs("").overridingErrorMessage("").withFailMessage("").withThreadDumpOnError().usingDefaultComparator().contains("Key1", atIndex(0));
}
use of org.assertj.core.description.Description in project assertj-core by joel-costigliola.
the class WritableAssertionInfo_descriptionText_Test method should_return_text_of_description.
@Test
public void should_return_text_of_description() {
Description description = mock(Description.class);
info.description(description);
when(description.value()).thenReturn("Yoda");
assertThat(info.descriptionText()).isEqualTo("Yoda");
}
use of org.assertj.core.description.Description in project assertj-core by joel-costigliola.
the class MapAssert_raw_map_assertions_chained_after_base_assertions_Test method raw_map_mixing_assertions_from_AbstractAssert_and_AbstractMapAssert.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Ignore
@Test
public void raw_map_mixing_assertions_from_AbstractAssert_and_AbstractMapAssert() {
Description description = emptyDescription();
Map map1 = new java.util.HashMap();
map1.put("Key1", "Value1");
map1.put("Key2", "Value2");
// try all base assertions followed by map specific ones using generics
assertThat(map1).as("desc").containsOnlyKeys("Key1", "Key2").as(description).containsOnlyKeys("Key1", "Key2").describedAs(description).describedAs("describedAs").has(null).hasSameClassAs(map1).hasToString(map1.toString()).is(null).isEqualTo(map1).isExactlyInstanceOf(Map.class).isIn(new ArrayList<>()).isIn(Map.class).isInstanceOf(Map.class).isInstanceOfAny(Map.class, String.class).isNot(null).isNotEqualTo(null).isNotEmpty().isNotExactlyInstanceOf(String.class).isNotIn(new ArrayList<>()).isNotIn(Map.class).isNotInstanceOf(Map.class).isNotInstanceOfAny(Map.class, String.class).isNotNull().isNotOfAnyClassIn(Map.class, String.class).isNotSameAs(null).isOfAnyClassIn(Map.class, String.class).isSameAs("").overridingErrorMessage("").withFailMessage("").withThreadDumpOnError().usingDefaultComparator().containsOnlyKeys("Key1", "Key2");
}
use of org.assertj.core.description.Description in project assertj-core by joel-costigliola.
the class BasicErrorMessageFactory_create_Test method should_create_error_with_empty_description_and_configured_representation.
@Test
public void should_create_error_with_empty_description_and_configured_representation() {
Description description = emptyDescription();
String formattedMessage = "[] Hello Yoda";
when(formatter.format(eq(description), same(CONFIGURATION_PROVIDER.representation()), eq("Hello %s"), eq("Yoda"))).thenReturn(formattedMessage);
assertThat(factory.create()).isEqualTo(formattedMessage);
}
use of org.assertj.core.description.Description in project assertj-core by joel-costigliola.
the class BasicErrorMessageFactory_create_Test method should_implement_toString.
@Test
public void should_implement_toString() {
Description description = new TestDescription("Test");
Representation representation = new StandardRepresentation();
String formattedMessage = "[Test] Hello Yoda";
when(formatter.format(description, representation, "Hello %s", "Yoda")).thenReturn(formattedMessage);
assertThat(factory.create(description, representation)).isEqualTo(formattedMessage);
}
Aggregations