コード例 #1
0
 /**
  * Verifies that the actual {@code CharSequence} has a length that's the same as the number of
  * elements in the given array.
  *
  * @param other the given array to be used for size comparison.
  * @return {@code this} assertion object.
  * @throws AssertionError if the actual {@code CharSequence} has a length that's different from
  *     the number of elements in the array.
  * @throws NullPointerException if the given array is {@code null}.
  */
 public S hasSameSizeAs(Object other) {
   strings.assertHasSameSizeAs(info, actual, other);
   return myself;
 }
コード例 #2
0
 /**
  * Verifies that the actual {@code CharSequence} has a length that's the same as the number of
  * elements in the given Iterable.
  *
  * @param other the given {@code Iterable} to be used for size comparison.
  * @return {@code this} assertion object.
  * @throws AssertionError if the actual {@code CharSequence} has a length that's different from
  *     the number of elements in the {@code Iterable}.
  * @throws NullPointerException if the given {@code Iterable} is {@code null}.
  */
 @Override
 public S hasSameSizeAs(Iterable<?> other) {
   strings.assertHasSameSizeAs(info, actual, other);
   return myself;
 }
コード例 #3
0
 /**
  * Verifies that the actual {@code CharSequence} has a length that's the same as the length of the
  * given {@code CharSequence}.
  *
  * <p>Examples :
  *
  * <pre>
  * // assertion will pass
  * assertThat(&quot;C-3PO&quot;).hasSameSizeAs(&quot;R2-D2&quot;);
  *
  * // assertion will fail as actual and expected sizes differ
  * assertThat(&quot;C-3PO&quot;).hasSameSizeAs(&quot;B1 battle droid&quot;);
  * </pre>
  *
  * @param other the given {@code CharSequence} to be used for size comparison.
  * @return {@code this} assertion object.
  * @throws AssertionError if the actual {@code CharSequence} has a length that's different from
  *     the length of the given {@code CharSequence}.
  * @throws NullPointerException if the given {@code CharSequence} is {@code null}.
  */
 public S hasSameSizeAs(CharSequence other) {
   strings.assertHasSameSizeAs(info, actual, other);
   return myself;
 }