use of org.assertj.core.internal.Iterables 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();
}
use of org.assertj.core.internal.Iterables in project assertj-core by joel-costigliola.
the class IterableAssert_usingComparatorForType_Test method verify_internal_effects.
@Override
protected void verify_internal_effects() {
Iterables iterables = getIterables(assertions);
assertThat(iterables).isNotSameAs(iterablesBefore);
assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
ComparatorBasedComparisonStrategy strategy = (ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy();
assertThat(strategy.getComparator()).isInstanceOf(ExtendedByTypesComparator.class);
}
use of org.assertj.core.internal.Iterables in project assertj-core by joel-costigliola.
the class IterableAssert_usingElementComparatorIgnoringFields_Test method verify_internal_effects.
@Override
protected void verify_internal_effects() {
Iterables iterables = getIterables(assertions);
assertThat(iterables).isNotSameAs(iterablesBefore);
assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
ComparatorBasedComparisonStrategy strategy = (ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy();
assertThat(strategy.getComparator()).isInstanceOf(ExtendedByTypesComparator.class);
assertThat(((IgnoringFieldsComparator) ((ExtendedByTypesComparator) strategy.getComparator()).getComparator()).getFields()).containsOnly("field");
}
use of org.assertj.core.internal.Iterables in project assertj-core by joel-costigliola.
the class AbstractIterableAssert method usingElementComparator.
/**
* {@inheritDoc}
*/
@Override
@CheckReturnValue
public SELF usingElementComparator(Comparator<? super ELEMENT> elementComparator) {
this.iterables = new Iterables(new ComparatorBasedComparisonStrategy(elementComparator));
// to have the same semantics on base assertions like isEqualTo, we need to use an iterable comparator comparing
// elements with elementComparator parameter
objects = new Objects(new IterableElementComparisonStrategy<>(elementComparator));
return myself;
}
use of org.assertj.core.internal.Iterables in project assertj-core by joel-costigliola.
the class IterableAssert_usingElementComparatorOnFields_Test method verify_internal_effects.
@Override
protected void verify_internal_effects() {
Iterables iterables = getIterables(assertions);
assertThat(iterables).isNotSameAs(iterablesBefore);
assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
ComparatorBasedComparisonStrategy strategy = (ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy();
assertThat(strategy.getComparator()).isInstanceOf(ExtendedByTypesComparator.class);
assertThat(((OnFieldsComparator) ((ExtendedByTypesComparator) strategy.getComparator()).getComparator()).getFields()).containsOnly("field");
}
Aggregations