|
||||||||||
| 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.PrimitiveAssert
org.fest.assertions.ByteAssert
public class ByteAssert
Understands assertion methods for bytes. To create a new instance of this class use the
method .
Assertions.assertThat(byte)
| Constructor Summary | |
|---|---|
protected |
ByteAssert(byte actual)
Creates a new ByteAssert. |
| 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 |
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 |
isNotEqualTo(byte other)
Verifies that the actual byte value is not equal to the given one. |
ByteAssert |
isPositive()
Verifies that the actual byte value is positive. |
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. |
| 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 target 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(value).as("Some value").isEqualTo(otherValue);
as in class PrimitiveAssertdescription - the description of the actual value.
public ByteAssert describedAs(String description)
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(value).describedAs("Some value").isEqualTo(otherValue);
describedAs in class PrimitiveAssertdescription - 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(value).as(new BasicDescription("Some value")).isEqualTo(otherValue);
as in class PrimitiveAssertdescription - the description of the actual value.
public ByteAssert describedAs(Description description)
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(value).describedAs(new BasicDescription("Some value")).isEqualTo(otherValue);
describedAs in class PrimitiveAssertdescription - 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 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 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 PrimitiveAssertmessage - the given error message, which will replace the default one.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||