|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fest.assertions.Assert
org.fest.assertions.GenericAssert<Byte>
org.fest.assertions.ByteAssert
public class ByteAssert
Understands assertion methods for Bytes and bytes. To create a new instance of this class call
or Assertions.assertThat(Byte).
Assertions.assertThat(byte)
| Field Summary |
|---|
| Fields inherited from class org.fest.assertions.GenericAssert |
|---|
actual |
| Constructor Summary | |
|---|---|
protected |
ByteAssert(byte actual)
Creates a new . |
protected |
ByteAssert(Byte actual)
Creates a new . |
| Method Summary | |
|---|---|
ByteAssert |
as(Description description)
Sets the description of the actual value, to be used in as message of any
thrown when an assertion fails. |
ByteAssert |
as(String description)
Sets the description of the actual value, to be used in as message of any
thrown when an assertion fails. |
ByteAssert |
describedAs(Description description)
Alias for , since "as" is a keyword in
Groovy. |
ByteAssert |
describedAs(String description)
Alias for , since "as" is a keyword in
Groovy. |
ByteAssert |
doesNotSatisfy(Condition<Byte> condition)
Verifies that the actual Byte does not satisfy the given condition. |
ByteAssert |
is(Condition<Byte> condition)
Alias for . |
ByteAssert |
isEqualTo(byte expected)
Verifies that the actual Byte value is equal to the given one. |
ByteAssert |
isEqualTo(Byte expected)
Verifies that the actual Byte value is equal to the given one. |
ByteAssert |
isGreaterThan(byte other)
Verifies that the actual Byte value is greater than the given one. |
ByteAssert |
isGreaterThanOrEqualTo(byte other)
Verifies that the actual Byte value is greater or equal to the given one. |
ByteAssert |
isLessThan(byte other)
Verifies that the actual Byte value is less than the given one. |
ByteAssert |
isLessThanOrEqualTo(byte other)
Verifies that the actual Byte value is less or equal to the given one. |
ByteAssert |
isNegative()
Verifies that the actual Byte value is negative. |
ByteAssert |
isNot(Condition<Byte> condition)
Alias for . |
ByteAssert |
isNotEqualTo(byte other)
Verifies that the actual Byte value is not equal to the given one. |
ByteAssert |
isNotEqualTo(Byte other)
Verifies that the actual Byte is not equal to the given one. |
ByteAssert |
isNotNull()
Verifies that the actual Byte is not null. |
ByteAssert |
isNotSameAs(Byte other)
Verifies that the actual Byte is not the same object as the given one. |
ByteAssert |
isPositive()
Verifies that the actual Byte value is positive. |
ByteAssert |
isSameAs(Byte expected)
Verifies that the actual Byte is the same object as the given one. |
ByteAssert |
isZero()
Verifies that the actual Byte value is equal to zero. |
ByteAssert |
overridingErrorMessage(String message)
Replaces the default message displayed in case of a failure with the given one. |
ByteAssert |
satisfies(Condition<Byte> condition)
Verifies that the actual Byte satisfies the given condition. |
| Methods inherited from class org.fest.assertions.GenericAssert |
|---|
assertDoesNotSatisfy, assertEqualTo, assertIs, assertIsNot, assertNotEqualTo, assertNotNull, assertNotSameAs, assertSameAs, assertSatisfies, isNull |
| Methods inherited from class org.fest.assertions.Assert |
|---|
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ByteAssert(byte actual)
ByteAssert.
actual - the actual value to verify.protected ByteAssert(Byte actual)
ByteAssert.
actual - the actual value to verify.| Method Detail |
|---|
public ByteAssert as(String description)
AssertionError
thrown when an assertion fails. This method should be called before any assertion method, otherwise any assertion
failure will not show the provided description.
For example:
assertThat(val).as("name").isEqualTo("Frodo");
as in class GenericAssert<Byte>description - the description of the actual value.
public ByteAssert describedAs(String description)
GenericAssert.as(String), since "as" is a keyword in
Groovy. This method should be called before any assertion
method, otherwise any assertion failure will not show the provided description.
For example:
assertThat(val).describedAs("name").isEqualTo("Frodo");
describedAs in class GenericAssert<Byte>description - the description of the actual value.
public ByteAssert as(Description description)
AssertionError
thrown when an assertion fails. This method should be called before any assertion method, otherwise any assertion
failure will not show the provided description.
For example:
assertThat(val).as(new BasicDescription("name")).isEqualTo("Frodo");
as in class GenericAssert<Byte>description - the description of the actual value.
public ByteAssert describedAs(Description description)
GenericAssert.as(Description), since "as" is a keyword in
Groovy. This method should be called before any assertion
method, otherwise any assertion failure will not show the provided description.
For example:
assertThat(val).describedAs(new BasicDescription("name")).isEqualTo("Frodo");
describedAs in class GenericAssert<Byte>description - the description of the actual value.
public ByteAssert isEqualTo(byte expected)
Byte value is equal to the given one.
expected - the value to compare the actual one to.
AssertionError - if the actual Byte value is not equal to the given one.public ByteAssert isEqualTo(Byte expected)
Byte value is equal to the given one.
isEqualTo in class GenericAssert<Byte>expected - the given Byte value to compare the actual Byte to.
AssertionError - if the actual Byte value is not equal to the given one.public ByteAssert isNotEqualTo(byte other)
Byte value is not equal to the given one.
other - the given value.
AssertionError - if the actual Byte value is equal to the given one.public ByteAssert isNotEqualTo(Byte other)
Byte is not equal to the given one.
isNotEqualTo in class GenericAssert<Byte>other - the given Byte to compare the actual Byte to.
AssertionError - if the actual Byte value is equal to the given one.public ByteAssert isGreaterThan(byte other)
Byte value is greater than the given one.
other - the given value.
AssertionError - if the actual Byte value is not greater than the given one.public ByteAssert isLessThan(byte other)
Byte value is less than the given one.
other - the given value.
AssertionError - if the actual Byte value is not less than the given one.public ByteAssert isGreaterThanOrEqualTo(byte other)
Byte value is greater or equal to the given one.
other - the given value.
AssertionError - if the actual Byte value is not greater than or equal to the given one.public ByteAssert isLessThanOrEqualTo(byte other)
Byte value is less or equal to the given one.
other - the given value.
AssertionError - if the actual Byte value is not less than or equal to the given one.public ByteAssert isZero()
Byte value is equal to zero.
isZero in interface NumberAssertAssertionError - if the actual Byte value is not equal to zero.public ByteAssert isPositive()
Byte value is positive.
isPositive in interface NumberAssertAssertionError - if the actual Byte value is not positive.public ByteAssert isNegative()
Byte value is negative.
isNegative in interface NumberAssertAssertionError - if the actual Byte value is not negative.public ByteAssert overridingErrorMessage(String message)
For example, the following assertion:
assertThat("Hello").isEqualTo("Bye");
will fail with the default message "expected:<'[Bye]'> but was:<'[Hello]'>."
We can replace this message with our own:
assertThat("Hello").overridingErrorMessage("'Hello' should be equal to 'Bye'").isEqualTo("Bye");
in this case, the assertion will fail showing the message "'Hello' should be equal to 'Bye'".
overridingErrorMessage in class GenericAssert<Byte>message - the given error message, which will replace the default one.
public ByteAssert satisfies(Condition<Byte> condition)
Byte satisfies the given condition.
satisfies in class GenericAssert<Byte>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual Byte does not satisfy the given condition.is(Condition)public ByteAssert doesNotSatisfy(Condition<Byte> condition)
Byte does not satisfy the given condition.
doesNotSatisfy in class GenericAssert<Byte>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual Byte does satisfies the given condition.isNot(Condition)public ByteAssert is(Condition<Byte> condition)
satisfies(Condition).
is in class GenericAssert<Byte>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual Byte does not satisfy the given condition.public ByteAssert isNot(Condition<Byte> condition)
doesNotSatisfy(Condition).
isNot in class GenericAssert<Byte>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual Byte does not satisfy the given condition.public ByteAssert isNotNull()
Byte is not null.
isNotNull in class GenericAssert<Byte>AssertionError - if the actual Byte value is null.public ByteAssert isSameAs(Byte expected)
Byte is the same object as the given one.
isSameAs in class GenericAssert<Byte>expected - the given Byte to compare the actual Byte to.
AssertionError - if the actual Byte value is not the same as the given one.public ByteAssert isNotSameAs(Byte other)
Byte is not the same object as the given one.
isNotSameAs in class GenericAssert<Byte>other - the given Byte to compare the actual Byte to.
AssertionError - if the actual Byte value is the same as the given one.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||