public void check() { List<ElementCheckFailure> failures = checkEquivalence(); if (!failures.isEmpty()) { throw new EquivalenceAssertionError(failures); } }
private static void assertExpectedFailures(EquivalenceAssertionError e, ElementCheckFailure... expected) { assertEqualsIgnoreOrder(e.getFailures(), newArrayList(expected)); } }
private static void assertExpectedFailures(EquivalenceAssertionError e, ElementCheckFailure... expected) { assertEqualsIgnoreOrder(e.getFailures(), newArrayList(expected)); } }
public void check() { List<ElementCheckFailure> failures = checkEquivalence(); if (!failures.isEmpty()) { throw new EquivalenceAssertionError(failures); } }
private void assertExpectedFailures(EquivalenceAssertionError e, ElementCheckFailure... expected) { assertEqualsIgnoreOrder(e.getFailures(), newArrayList(expected)); } }
public void check() { List<ElementCheckFailure> failures = checkEquivalence(); if (!failures.isEmpty()) { throw new EquivalenceAssertionError(failures); } }
@Test public void notEqual() { try { equivalenceTester() .addEquivalentGroup("foo") .addEquivalentGroup("foo") .check(); fail("Expected EquivalenceAssertionError"); } catch (EquivalenceAssertionError e) { assertEqualsIgnoreOrder( e.getFailures(), newArrayList( new PairCheckFailure(EQUAL, 0, 0, "foo", 1, 0, "foo"), new PairCheckFailure(EQUAL, 1, 0, "foo", 0, 0, "foo"), new PairCheckFailure(COMPARE_EQUAL, 0, 0, "foo", 1, 0, "foo"), new PairCheckFailure(COMPARE_EQUAL, 1, 0, "foo", 0, 0, "foo"))); } }
throw new EquivalenceAssertionError(failures);
@Test public void notEqual() { try { equivalenceTester() .addEquivalentGroup("foo") .addEquivalentGroup("foo") .check(); fail("Expected EquivalenceAssertionError"); } catch (EquivalenceAssertionError e) { assertEqualsIgnoreOrder( e.getFailures(), newArrayList( new PairCheckFailure(EQUAL, 0, 0, "foo", 1, 0, "foo"), new PairCheckFailure(EQUAL, 1, 0, "foo", 0, 0, "foo"), new PairCheckFailure(COMPARE_EQUAL, 0, 0, "foo", 1, 0, "foo"), new PairCheckFailure(COMPARE_EQUAL, 1, 0, "foo", 0, 0, "foo"))); } }
throw new EquivalenceAssertionError(failures);
@Test public void notEqual() { try { equivalenceTester() .addEquivalentGroup("foo") .addEquivalentGroup("foo") .check(); fail("Expected EquivalenceAssertionError"); } catch (EquivalenceAssertionError e) { assertEqualsIgnoreOrder( e.getFailures(), newArrayList( new PairCheckFailure(EQUAL, 0, 0, "foo", 1, 0, "foo"), new PairCheckFailure(EQUAL, 1, 0, "foo", 0, 0, "foo"), new PairCheckFailure(COMPARE_EQUAL, 0, 0, "foo", 1, 0, "foo"), new PairCheckFailure(COMPARE_EQUAL, 1, 0, "foo", 0, 0, "foo") ) ); } }
throw new EquivalenceAssertionError(failures);