Search in sources :

Example 6 with AbsValueComparator

use of org.assertj.core.util.AbsValueComparator in project assertj-core by joel-costigliola.

the class AtomicIntegerArrayAssert_usingElementComparator_Test method should_honor_the_given_element_comparator.

@Test
public void should_honor_the_given_element_comparator() {
    AtomicIntegerArray actual = new AtomicIntegerArray(new int[] { 1, 2, 3, 4 });
    assertThat(actual).usingElementComparator(new AbsValueComparator<Integer>()).containsExactly(-1, 2, 3, -4);
}
Also used : AtomicIntegerArray(java.util.concurrent.atomic.AtomicIntegerArray) AbsValueComparator(org.assertj.core.util.AbsValueComparator) AtomicIntegerArrayAssertBaseTest(org.assertj.core.api.AtomicIntegerArrayAssertBaseTest) Test(org.junit.Test)

Example 7 with AbsValueComparator

use of org.assertj.core.util.AbsValueComparator 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;
}
Also used : Doubles(org.assertj.core.internal.Doubles) AbsValueComparator(org.assertj.core.util.AbsValueComparator) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) Failures(org.assertj.core.internal.Failures) Before(org.junit.Before)

Example 8 with AbsValueComparator

use of org.assertj.core.util.AbsValueComparator 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;
}
Also used : Integers(org.assertj.core.internal.Integers) AbsValueComparator(org.assertj.core.util.AbsValueComparator) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) Failures(org.assertj.core.internal.Failures) Before(org.junit.Before)

Example 9 with AbsValueComparator

use of org.assertj.core.util.AbsValueComparator in project assertj-core by joel-costigliola.

the class LongsBaseTest method setUp.

@Before
public void setUp() {
    failures = spy(new Failures());
    longs = new Longs();
    longs.setFailures(failures);
    absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(new AbsValueComparator<Long>());
    longsWithAbsValueComparisonStrategy = new Longs(absValueComparisonStrategy);
    longsWithAbsValueComparisonStrategy.failures = failures;
}
Also used : Longs(org.assertj.core.internal.Longs) AbsValueComparator(org.assertj.core.util.AbsValueComparator) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) Failures(org.assertj.core.internal.Failures) Before(org.junit.Before)

Aggregations

AbsValueComparator (org.assertj.core.util.AbsValueComparator)9 ComparatorBasedComparisonStrategy (org.assertj.core.internal.ComparatorBasedComparisonStrategy)5 Failures (org.assertj.core.internal.Failures)5 Before (org.junit.Before)5 Test (org.junit.Test)4 AtomicIntegerArray (java.util.concurrent.atomic.AtomicIntegerArray)2 AtomicLongArray (java.util.concurrent.atomic.AtomicLongArray)2 AtomicIntegerArrayAssertBaseTest (org.assertj.core.api.AtomicIntegerArrayAssertBaseTest)2 AtomicLongArrayAssertBaseTest (org.assertj.core.api.AtomicLongArrayAssertBaseTest)2 Doubles (org.assertj.core.internal.Doubles)1 Floats (org.assertj.core.internal.Floats)1 Integers (org.assertj.core.internal.Integers)1 Longs (org.assertj.core.internal.Longs)1 Shorts (org.assertj.core.internal.Shorts)1