use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class ShouldBeIn_create_Test method should_create_error_message_with_custom_comparison_strategy.
@Test
public void should_create_error_message_with_custom_comparison_strategy() {
factory = shouldBeIn("Yoda", array("Luke", "Leia"), new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <\"Yoda\">%nto be in:%n <[\"Luke\", \"Leia\"]>%nwhen comparing values using CaseInsensitiveStringComparator"));
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class ShouldBeSubsetOf_create_Test method should_create_error_message_with_custom_comparison_strategy.
@Test
public void should_create_error_message_with_custom_comparison_strategy() {
ErrorMessageFactory factory = shouldBeSubsetOf(newArrayList("Yoda", "Luke"), newArrayList("Han", "Luke"), newArrayList("Yoda"), new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting when comparing values using CaseInsensitiveStringComparator:%n <[\"Yoda\", \"Luke\"]>%nto be subset of%n <[\"Han\", \"Luke\"]>%nbut found these extra elements:%n <[\"Yoda\"]>"));
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class StringsBaseTest method setUp.
@Before
public void setUp() {
failures = spy(new Failures());
strings = new Strings();
strings.failures = failures;
comparisonStrategy = new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance);
stringsWithCaseInsensitiveComparisonStrategy = new Strings(comparisonStrategy);
stringsWithCaseInsensitiveComparisonStrategy.failures = failures;
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class FloatsBaseTest method setUp.
@Before
public void setUp() {
failures = spy(new Failures());
floats = new Floats();
floats.setFailures(failures);
absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(new AbsValueComparator<Float>());
floatsWithAbsValueComparisonStrategy = new Floats(absValueComparisonStrategy);
floatsWithAbsValueComparisonStrategy.failures = failures;
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class IterablesBaseTest method setUp.
@Before
public void setUp() {
actual = newArrayList("Luke", "Yoda", "Leia");
failures = spy(new Failures());
iterables = new Iterables();
iterables.failures = failures;
comparisonStrategy = new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance);
iterablesWithCaseInsensitiveComparisonStrategy = new Iterables(comparisonStrategy);
iterablesWithCaseInsensitiveComparisonStrategy.failures = failures;
info = someInfo();
}
Aggregations