|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.assertj.core.api.AbstractAssert<S,A>
org.assertj.core.api.AbstractEnumerableAssert<S,A,E>
S - the "self" type of this assertion class.A - the type of the "actual" value which is an Array of E.E - the type of the "actual" array element.public abstract class AbstractEnumerableAssert<S extends AbstractEnumerableAssert<S,A,E>,A,E>
Base implementation for Enumerable class assertions.
| Field Summary |
|---|
| Fields inherited from class org.assertj.core.api.AbstractAssert |
|---|
actual, info, myself |
| Constructor Summary | |
|---|---|
protected |
AbstractEnumerableAssert(A actual,
Class<?> selfType)
|
| Method Summary | |
|---|---|
S |
hasSameSizeAs(Object other)
Verifies that the actual group has the same size as given array. |
S |
inBinary()
Use binary object representation instead of standard representation in error messages. |
S |
inHexadecimal()
Enable hexadecimal object representation of Iterable elements instead of standard java representation in error messages. |
| Methods inherited from class org.assertj.core.api.AbstractAssert |
|---|
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, usingComparator, usingDefaultComparator |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.assertj.core.api.EnumerableAssert |
|---|
hasSameSizeAs, hasSize, isEmpty, isNotEmpty, isNullOrEmpty, usingDefaultElementComparator, usingElementComparator |
| Constructor Detail |
|---|
protected AbstractEnumerableAssert(A actual,
Class<?> selfType)
| Method Detail |
|---|
public S hasSameSizeAs(Object other)
Example with byte array:
// assertions will pass
assertThat(new byte[]{1, 2}).hasSameSizeAs(new byte[]{2, 3});
assertThat(new byte[]{1, 2}).hasSameSizeAs(new Byte[]{2, 3});
assertThat(new byte[]{1, 2}).hasSameSizeAs(new int[]{2, 3});
assertThat(new byte[]{1, 2}).hasSameSizeAs(new String[]{"1", "2"});
// assertion will fail
assertThat(new byte[]{ 1, 2 }).hasSameSizeAs(new byte[]{ 1, 2, 3 });
hasSameSizeAs in interface EnumerableAssert<AbstractEnumerableAssert<S extends AbstractEnumerableAssert<S,A,E>,A,E>,E>other - the array to compare size with actual group.
this assertion object.public S inHexadecimal()
assertThat(new byte[]{0x10,0x20}).inHexadecimal().contains(new byte[]{0x30});
With standard error message:
Expecting: <[16, 32]> to contain: <[48]> but could not find: <[48]>With Hexadecimal error message:
Expecting: <[0x10, 0x20]> to contain: <[0x30]> but could not find: <[0x30]>
inHexadecimal in class AbstractAssert<S extends AbstractEnumerableAssert<S,A,E>,A>this assertion object.public S inBinary()
AbstractAssertassertThat(1).inBinary().isEqualTo(2); org.junit.ComparisonFailure: Expected :0b00000000_00000000_00000000_00000010 Actual :0b00000000_00000000_00000000_00000001
inBinary in class AbstractAssert<S extends AbstractEnumerableAssert<S,A,E>,A>this assertion object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||