/** * Asserts that the given array contains the given values, in any order. * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not contain the given values. */ public void assertContains(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContains(info, failures, actual, toByteArray(values)); }
/** * Verifies that the given array contains the given sequence of values, without any other values between them. * @param info contains information about the assertion. * @param actual the given array. * @param sequence the sequence of values to look for. * @throws AssertionError if the given array is {@code null}. * @throws NullPointerException if the given sequence is {@code null}. * @throws IllegalArgumentException if the given sequence is empty. * @throws AssertionError if the given array does not contain the given sequence of values. */ public void assertContainsSequence(AssertionInfo info, byte[] actual, int[] sequence) { arrays.assertContainsSequence(info, failures, actual, toByteArray(sequence)); }
/** * Asserts that the given array does not contain the given values. * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected not to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array contains any of given values. */ public void assertDoesNotContain(AssertionInfo info, byte[] actual, int[] values) { arrays.assertDoesNotContain(info, failures, actual, toByteArray(values)); }
public void assertContainsExactly(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsExactly(info, failures, actual, toByteArray(values)); }
/** * Asserts that the given array contains only the given values and nothing else, in any order. * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not contain the given values or if the given array contains values that are * not in the given array. */ public void assertContainsOnly(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsOnly(info, failures, actual, toByteArray(values)); }
/** * Verifies that the given array contains the given sequence of values (possibly with other values between them). * * @param info contains information about the assertion. * @param actual the given array. * @param subsequence the subsequence of values to look for. * @throws AssertionError if the given array is {@code null}. * @throws NullPointerException if the given sequence is {@code null}. * @throws IllegalArgumentException if the given sequence is empty. * @throws AssertionError if the given array does not contain the given sequence of values. */ public void assertContainsSubsequence(AssertionInfo info, byte[] actual, int[] subsequence) { arrays.assertContainsSubsequence(info, failures, actual, toByteArray(subsequence)); }
/** * Verifies that the given array starts with the given sequence of values, without any other values between them. Similar to * <code>{@link #assertContainsSequence(AssertionInfo, byte[], byte[])}</code>, but it also verifies that the first element in * the sequence is also the first element of the given array. * @param info contains information about the assertion. * @param actual the given array. * @param sequence the sequence of values to look for. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not start with the given sequence of values. */ public void assertStartsWith(AssertionInfo info, byte[] actual, int[] sequence) { arrays.assertStartsWith(info, failures, actual, toByteArray(sequence)); }
public void assertContainsExactlyInAnyOrder(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsExactlyInAnyOrder(info, failures, actual, toByteArray(values)); }
/** * Asserts that the given array contains only once the given values. * * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not contain the given values or if the given array contains more * than once values. */ public void assertContainsOnlyOnce(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsOnlyOnce(info, failures, actual, toByteArray(values)); }
/** * Verifies that the given array ends with the given sequence of values, without any other values between them. Similar to * <code>{@link #assertContainsSequence(AssertionInfo, byte[], byte[])}</code>, but it also verifies that the last element in * the sequence is also the last element of the given array. * @param info contains information about the assertion. * @param actual the given array. * @param sequence the sequence of values to look for. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not end with the given sequence of values. */ public void assertEndsWith(AssertionInfo info, byte[] actual, int[] sequence) { arrays.assertEndsWith(info, failures, actual, toByteArray(sequence)); }
/** * Asserts that the given array contains only the given values and nothing else, in any order. * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not contain the given values or if the given array contains values that are * not in the given array. */ public void assertContainsOnly(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsOnly(info, failures, actual, toByteArray(values)); }
public void assertContainsExactlyInAnyOrder(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsExactlyInAnyOrder(info, failures, actual, toByteArray(values)); }
/** * Verifies that the given array contains the given sequence of values, without any other values between them. * @param info contains information about the assertion. * @param actual the given array. * @param sequence the sequence of values to look for. * @throws AssertionError if the given array is {@code null}. * @throws NullPointerException if the given sequence is {@code null}. * @throws IllegalArgumentException if the given sequence is empty. * @throws AssertionError if the given array does not contain the given sequence of values. */ public void assertContainsSequence(AssertionInfo info, byte[] actual, int[] sequence) { arrays.assertContainsSequence(info, failures, actual, toByteArray(sequence)); }
/** * Asserts that the given array contains the given values, in any order. * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not contain the given values. */ public void assertContains(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContains(info, failures, actual, toByteArray(values)); }
/** * Asserts that the given array does not contain the given values. * @param info contains information about the assertion. * @param actual the given array. * @param values the values that are expected not to be in the given array. * @throws NullPointerException if the array of values is {@code null}. * @throws IllegalArgumentException if the array of values is empty. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array contains any of given values. */ public void assertDoesNotContain(AssertionInfo info, byte[] actual, int[] values) { arrays.assertDoesNotContain(info, failures, actual, toByteArray(values)); }
/** * Verifies that the given array starts with the given sequence of values, without any other values between them. Similar to * <code>{@link #assertContainsSequence(AssertionInfo, byte[], byte[])}</code>, but it also verifies that the first element in * the sequence is also the first element of the given array. * @param info contains information about the assertion. * @param actual the given array. * @param sequence the sequence of values to look for. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not start with the given sequence of values. */ public void assertStartsWith(AssertionInfo info, byte[] actual, int[] sequence) { arrays.assertStartsWith(info, failures, actual, toByteArray(sequence)); }
/** * Verifies that the given array contains the given sequence of values (possibly with other values between them). * * @param info contains information about the assertion. * @param actual the given array. * @param subsequence the subsequence of values to look for. * @throws AssertionError if the given array is {@code null}. * @throws NullPointerException if the given sequence is {@code null}. * @throws IllegalArgumentException if the given sequence is empty. * @throws AssertionError if the given array does not contain the given sequence of values. */ public void assertContainsSubsequence(AssertionInfo info, byte[] actual, int[] subsequence) { arrays.assertContainsSubsequence(info, failures, actual, toByteArray(subsequence)); }
public void assertContainsExactly(AssertionInfo info, byte[] actual, int[] values) { arrays.assertContainsExactly(info, failures, actual, toByteArray(values)); }
/** * Verifies that the actual group contains exactly the given values and nothing else, <b>in any order</b>.<br> * <p> * Example : * <pre><code class='java'> // assertions will pass * assertThat(new byte[] { 1, 2 }).containsExactlyInAnyOrder(1, 2); * assertThat(new byte[] { 1, 2, 1 }).containsExactlyInAnyOrder(1, 1, 2); * * // assertions will fail * assertThat(new byte[] { 1, 2 }).containsExactlyInAnyOrder(1); * assertThat(new byte[] { 1 }).containsExactlyInAnyOrder(1, 2); * assertThat(new byte[] { 1, 2, 1 }).containsExactlyInAnyOrder(1, 2);</code></pre> * * @param values the given values. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws AssertionError if the actual group is {@code null}. * @throws AssertionError if the actual group does not contain the given values, i.e. the actual group * contains some or none of the given values, or the actual group contains more values than the given ones. * @since 2.6.0 / 3.6.0 */ public SELF containsExactlyInAnyOrder(int... values) { arrays.assertContainsExactlyInAnyOrder(info, actual, arrays.toByteArray(values)); return myself; }
/** * Verifies that the actual group contains only the given values and nothing else, <b>in order</b>. * <p> * Example : * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsExactly(1, 2, 3); * * // assertion will fail as actual and expected order differ * assertThat(new byte[] { 1, 2, 3 }).containsExactly(2, 1, 3);</code></pre> * * @param values the given values. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws AssertionError if the actual group is {@code null}. * @throws AssertionError if the actual group does not contain the given values with same order, i.e. the actual * group * contains some or none of the given values, or the actual group contains more values * than the given ones * or values are the same but the order is not. * @since 2.6.0 / 3.6.0 */ public SELF containsExactly(int... values) { arrays.assertContainsExactly(info, actual, arrays.toByteArray(values)); return myself; }