use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class ShouldNotContainAtIndex_create_Test method should_create_error_message_with_custom_comparison_strategy.
@Test
public void should_create_error_message_with_custom_comparison_strategy() {
factory = shouldNotContainAtIndex(newArrayList("Yoda", "Luke"), "Luke", atIndex(1), new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <[\"Yoda\", \"Luke\"]>%nnot to contain:%n <\"Luke\">%n" + "at index <1>%n" + "when comparing values using CaseInsensitiveStringComparator"));
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class ShouldEndWith_create_Test method should_create_error_message_with_custom_comparison_strategy.
@Test
public void should_create_error_message_with_custom_comparison_strategy() {
factory = shouldEndWith(newArrayList("Yoda", "Luke"), newArrayList("Han", "Leia"), new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <[\"Yoda\", \"Luke\"]>%nto end with:%n <[\"Han\", \"Leia\"]>%n" + "when comparing values using CaseInsensitiveStringComparator"));
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class DoublesBaseTest method setUp.
@Before
public void setUp() {
failures = spy(new Failures());
doubles = new Doubles();
doubles.setFailures(failures);
absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(new AbsValueComparator<Double>());
doublesWithAbsValueComparisonStrategy = new Doubles(absValueComparisonStrategy);
doublesWithAbsValueComparisonStrategy.failures = failures;
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class IntegersBaseTest method setUp.
@Before
public void setUp() {
failures = spy(new Failures());
integers = new Integers();
integers.setFailures(failures);
absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(new AbsValueComparator<Integer>());
integersWithAbsValueComparisonStrategy = new Integers(absValueComparisonStrategy);
integersWithAbsValueComparisonStrategy.failures = failures;
}
use of org.assertj.core.internal.ComparatorBasedComparisonStrategy in project assertj-core by joel-costigliola.
the class ListsBaseTest method setUp.
@Before
public void setUp() {
failures = spy(new Failures());
lists = new Lists();
lists.failures = failures;
comparisonStrategy = new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance);
listsWithCaseInsensitiveComparisonStrategy = new Lists(comparisonStrategy);
listsWithCaseInsensitiveComparisonStrategy.failures = failures;
}
Aggregations