arrays.assertContains(info, actual, values); return myself;
arrays.assertContainsOnly(info, actual, values); return myself;
arrays.assertContainsOnlyOnce(info, actual, values); return myself;
arrays.assertDoesNotContain(info, actual, value, index); return myself;
/** {@inheritDoc} */ @Override @CheckReturnValue public SELF usingElementComparator(Comparator<? super Double> customComparator) { this.arrays = new DoubleArrays(new ComparatorBasedComparisonStrategy(customComparator)); return myself; }
/** {@inheritDoc} */ @Override public void isEmpty() { arrays.assertEmpty(info, actual); }
/** * Verifies that the actual array does not contain duplicates. * <p> * If you want to set a precision for the comparison either use {@link #doesNotHaveDuplicates(Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new double[] { 1.0, 2.0, 3.0 }).doesNotHaveDuplicates(); * assertThat(new double[] { 1.0, 1.1 }).usingComparatorWithPrecision(0.01) * .doesNotHaveDuplicates(); * * // assertion will fail * assertThat(new double[] { 1.0, 1.0, 2.0, 3.0 }).doesNotHaveDuplicates(); * assertThat(new double[] { 1.0, 1.1 }).usingComparatorWithPrecision(0.5) * .doesNotHaveDuplicates();</code></pre> * * @return {@code this} assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the actual array contains duplicates. */ public SELF doesNotHaveDuplicates() { arrays.assertDoesNotHaveDuplicates(info, actual); return myself; }
arrays.assertContainsSequence(info, actual, sequence); return myself;
/** * Verifies that the actual array ends with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(double...)}</code>, but it also verifies that the last element in the * sequence is also last element of the actual array. * <p> * If you want to set a precision for the comparison either use {@link #endsWith(double[], Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> double[] values = new double[] { 1.0, 2.0, 3.0 }; * * // assertion will pass * assertThat(values).endsWith(2.0, 3.0) * .usingComparatorWithPrecision(0.5) * .endsWith(2.1, 3.1); * * // assertion will fail * assertThat(values).endsWith(1.0, 3.0);</code></pre> * * @param sequence the sequence of values to look for. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the actual array does not end with the given sequence. */ public SELF endsWith(double... sequence) { arrays.assertEndsWith(info, actual, sequence); return myself; }
arrays.assertContainsSubsequence(info, actual, subsequence); return myself;
/** * Verifies that the actual array does not contain the given values. * <p> * If you want to set a precision for the comparison either use {@link #doesNotContain(double[], Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> double[] values = new double[] { 1.0, 2.0, 3.0 }; * * // assertion will pass * assertThat(values).doesNotContain(4.0, 8.0) * .usingComparatorWithPrecision(0.0001) * .doesNotContain(1.01, 2.01); * * // assertions will fail * assertThat(values).doesNotContain(1.0, 4.0, 8.0); * assertThat(values).usingComparatorWithPrecision(0.1) * .doesNotContain(1.001, 2.001);</code></pre> * * @param values the given values. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the actual array contains any of the given values. */ public SELF doesNotContain(double... values) { arrays.assertDoesNotContain(info, actual, values); return myself; }
/** {@inheritDoc} */ @Override @CheckReturnValue public SELF usingElementComparator(Comparator<? super Double> customComparator) { this.arrays = new DoubleArrays(new ComparatorBasedComparisonStrategy(customComparator)); return myself; }
/** {@inheritDoc} */ @Override public void isEmpty() { arrays.assertEmpty(info, actual); }
/** * Verifies that the actual array does not contain duplicates. * <p> * If you want to set a precision for the comparison either use {@link #doesNotHaveDuplicates(Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new double[] { 1.0, 2.0, 3.0 }).doesNotHaveDuplicates(); * assertThat(new double[] { 1.0, 1.1 }).usingComparatorWithPrecision(0.01) * .doesNotHaveDuplicates(); * * // assertion will fail * assertThat(new double[] { 1.0, 1.0, 2.0, 3.0 }).doesNotHaveDuplicates(); * assertThat(new double[] { 1.0, 1.1 }).usingComparatorWithPrecision(0.5) * .doesNotHaveDuplicates();</code></pre> * * @return {@code this} assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the actual array contains duplicates. */ public SELF doesNotHaveDuplicates() { arrays.assertDoesNotHaveDuplicates(info, actual); return myself; }
arrays.assertContainsSequence(info, actual, sequence); return myself;
/** * Verifies that the actual array ends with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(double...)}</code>, but it also verifies that the last element in the * sequence is also last element of the actual array. * <p> * If you want to set a precision for the comparison either use {@link #endsWith(double[], Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> double[] values = new double[] { 1.0, 2.0, 3.0 }; * * // assertion will pass * assertThat(values).endsWith(2.0, 3.0) * .usingComparatorWithPrecision(0.5) * .endsWith(2.1, 3.1); * * // assertion will fail * assertThat(values).endsWith(1.0, 3.0);</code></pre> * * @param sequence the sequence of values to look for. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the actual array does not end with the given sequence. */ public SELF endsWith(double... sequence) { arrays.assertEndsWith(info, actual, sequence); return myself; }
arrays.assertContainsSubsequence(info, actual, subsequence); return myself;
arrays.assertDoesNotContain(info, actual, value, index); return myself;
arrays.assertContains(info, actual, value, index); return myself;
/** {@inheritDoc} */ @Override public S usingElementComparator(Comparator<? super Double> customComparator) { this.arrays = new DoubleArrays(new ComparatorBasedComparisonStrategy(customComparator)); return myself; }