private boolean isActualIn(Object actual, Iterable<?> values) { for (Object value : values) { if (areEqual(actual, value)) { return true; } } return false; }
/** * Returns <code>true</code> if given item is in given array, <code>false</code> otherwise. * * @param item the object to look for in arrayOfValues * @param arrayOfValues the array of values * @return <code>true</code> if given item is in given array, <code>false</code> otherwise. */ private boolean isItemInArray(Object item, Object[] arrayOfValues) { for (Object value : arrayOfValues) { if (areEqual(value, item)) return true; } return false; }
private boolean isActualIn(Object actual, Iterable<?> values) { for (Object value : values) { if (areEqual(actual, value)) { return true; } } return false; }
/** * Returns <code>true</code> if given item is in given array, <code>false</code> otherwise. * * @param item the object to look for in arrayOfValues * @param arrayOfValues the array of values * @return <code>true</code> if given item is in given array, <code>false</code> otherwise. */ private boolean isItemInArray(Object item, Object[] arrayOfValues) { for (Object value : arrayOfValues) { if (areEqual(value, item)) return true; } return false; }
/** * Asserts that two objects are not equal. * * @param info contains information about the assertion. * @param actual the given object. * @param other the object to compare {@code actual} to. * @throws AssertionError if {@code actual} is equal to {@code other}. */ public void assertNotEqual(AssertionInfo info, Object actual, Object other) { if (!areEqual(actual, other)) { return; } throw failures.failure(info, shouldNotBeEqual(actual, other, comparisonStrategy)); }
/** * Asserts that two objects are not equal. * * @param info contains information about the assertion. * @param actual the given object. * @param other the object to compare {@code actual} to. * @throws AssertionError if {@code actual} is equal to {@code other}. */ public void assertNotEqual(AssertionInfo info, Object actual, Object other) { if (areEqual(actual, other)) throw failures.failure(info, shouldNotBeEqual(actual, other, comparisonStrategy)); }
/** * Asserts that two objects are equal. * * @param info contains information about the assertion. * @param actual the "actual" object. * @param expected the "expected" object. * @throws AssertionError if {@code actual} is not equal to {@code expected}. This method will throw a * {@code org.junit.ComparisonFailure} instead if JUnit is in the classpath and the given objects are not * equal. */ public void assertEqual(AssertionInfo info, Object actual, Object expected) { if (areEqual(actual, expected)) { return; } throw failures.failure(info, shouldBeEqual(actual, expected, comparisonStrategy, info.representation())); }
/** * Asserts that two objects are equal. * * @param info contains information about the assertion. * @param actual the "actual" object. * @param expected the "expected" object. * @throws AssertionError if {@code actual} is not equal to {@code expected}. This method will throw a * {@code org.junit.ComparisonFailure} instead if JUnit is in the classpath and the given objects are not * equal. */ public void assertEqual(AssertionInfo info, Object actual, Object expected) { if (!areEqual(actual, expected)) throw failures.failure(info, shouldBeEqual(actual, expected, comparisonStrategy, info.representation())); }
private boolean isActualIn(Object actual, Iterable<?> values) { for (Object value : values) { if (areEqual(value, actual)) { return true; } } return false; }
/** * Returns <code>true</code> if given item is in given array, <code>false</code> otherwise. * * @param item the object to look for in arrayOfValues * @param arrayOfValues the array of values * @return <code>true</code> if given item is in given array, <code>false</code> otherwise. */ private boolean isItemInArray(Object item, Object[] arrayOfValues) { for (Object value : arrayOfValues) { if (areEqual(value, item)) return true; } return false; }
/** * Asserts that two objects are not equal. * * @param info contains information about the assertion. * @param actual the given object. * @param other the object to compare {@code actual} to. * @throws AssertionError if {@code actual} is equal to {@code other}. */ public void assertNotEqual(AssertionInfo info, Object actual, Object other) { if (!areEqual(actual, other)) { return; } throw failures.failure(info, shouldNotBeEqual(actual, other, comparisonStrategy)); }
/** * Asserts that two objects are equal. * * @param info contains information about the assertion. * @param actual the "actual" object. * @param expected the "expected" object. * @throws AssertionError if {@code actual} is not equal to {@code expected}. This method will throw a * {@code org.junit.ComparisonFailure} instead if JUnit is in the classpath and the given objects are not * equal. */ public void assertEqual(AssertionInfo info, Object actual, Object expected) { if (areEqual(actual, expected)) { return; } throw failures.failure(info, shouldBeEqual(actual, expected, comparisonStrategy, info.representation())); }