|
||||||||||
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<Short>
org.fest.assertions.ShortAssert
public class ShortAssert
Understands assertion methods for Short
s and short
s. To create a new instance of this class call
Assertions.assertThat(Short)
.
Assertions.assertThat(short)
Field Summary |
---|
Fields inherited from class org.fest.assertions.GenericAssert |
---|
actual |
Constructor Summary | |
---|---|
protected |
ShortAssert(short actual)
Creates a new . |
protected |
ShortAssert(Short actual)
Creates a new . |
Method Summary | |
---|---|
ShortAssert |
as(Description description)
Sets the description of the actual value, to be used in as message of any
thrown when an assertion fails. |
ShortAssert |
as(String description)
Sets the description of the actual value, to be used in as message of any
thrown when an assertion fails. |
ShortAssert |
describedAs(Description description)
Alias for , since "as" is a keyword in
Groovy. |
ShortAssert |
describedAs(String description)
Alias for , since "as" is a keyword in
Groovy. |
ShortAssert |
doesNotSatisfy(Condition<Short> condition)
Verifies that the actual Short does not satisfy the given condition. |
ShortAssert |
is(Condition<Short> condition)
Alias for . |
ShortAssert |
isEqualTo(short expected)
Verifies that the actual Short is equal to the given one. |
ShortAssert |
isEqualTo(Short expected)
Verifies that the actual Short is equal to the given one. |
ShortAssert |
isGreaterThan(short other)
Verifies that the actual Short is greater than the given one. |
ShortAssert |
isGreaterThanOrEqualTo(short other)
Verifies that the actual Short is greater or equal to the given one. |
ShortAssert |
isLessThan(short other)
Verifies that the actual Short is less than the given one. |
ShortAssert |
isLessThanOrEqualTo(short other)
Verifies that the actual Short is less or equal to the given one. |
ShortAssert |
isNegative()
Verifies that the actual Short is negative. |
ShortAssert |
isNot(Condition<Short> condition)
Alias for . |
ShortAssert |
isNotEqualTo(short other)
Verifies that the actual Short is not equal to the given one. |
ShortAssert |
isNotEqualTo(Short other)
Verifies that the actual Short is not equal to the given one. |
ShortAssert |
isNotNull()
Verifies that the actual Short is not null . |
ShortAssert |
isNotSameAs(Short other)
Verifies that the actual Short is not the same object as the given one. |
ShortAssert |
isPositive()
Verifies that the actual Short is positive. |
ShortAssert |
isSameAs(Short expected)
Verifies that the actual Short is the same object as the given one. |
ShortAssert |
isZero()
Verifies that the actual Short is equal to zero. |
ShortAssert |
overridingErrorMessage(String message)
Replaces the default message displayed in case of a failure with the given one. |
ShortAssert |
satisfies(Condition<Short> condition)
Verifies that the actual Short 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 ShortAssert(short actual)
ShortAssert
.
actual
- the actual value to verify.protected ShortAssert(Short actual)
ShortAssert
.
actual
- the actual value to verify.Method Detail |
---|
public ShortAssert 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<Short>
description
- the description of the actual value.
public ShortAssert 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<Short>
description
- the description of the actual value.
public ShortAssert 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<Short>
description
- the description of the actual value.
public ShortAssert 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<Short>
description
- the description of the actual value.
public ShortAssert isEqualTo(short expected)
Short
is equal to the given one.
expected
- the value to compare the actual one to.
AssertionError
- if the actual Short
is not equal to the given one.public ShortAssert isEqualTo(Short expected)
Short
is equal to the given one.
isEqualTo
in class GenericAssert<Short>
expected
- the given value to compare the actual Short
to.
AssertionError
- if the actual Short
is not equal to the given one.public ShortAssert isNotEqualTo(short other)
Short
is not equal to the given one.
other
- the given value.
AssertionError
- if the actual Short
is equal to the given one.public ShortAssert isNotEqualTo(Short other)
Short
is not equal to the given one.
isNotEqualTo
in class GenericAssert<Short>
other
- the given value to compare the actual Short
to.
AssertionError
- if the actual Short
is equal to the given one.public ShortAssert isGreaterThan(short other)
Short
is greater than the given one.
other
- the given value.
AssertionError
- if the actual Short
is not greater than the given one.public ShortAssert isLessThan(short other)
Short
is less than the given one.
other
- the given value.
AssertionError
- if the actual Short
is not less than the given one.public ShortAssert isGreaterThanOrEqualTo(short other)
Short
is greater or equal to the given one.
other
- the given value.
AssertionError
- if the actual Short
is not greater than or equal to the given one.public ShortAssert isLessThanOrEqualTo(short other)
Short
is less or equal to the given one.
other
- the given value.
AssertionError
- if the actual Short
is not less than or equal to the given one.public ShortAssert isZero()
Short
is equal to zero.
isZero
in interface NumberAssert
AssertionError
- if the actual Short
is not equal to zero.public ShortAssert isPositive()
Short
is positive.
isPositive
in interface NumberAssert
AssertionError
- if the actual Short
is not positive.public ShortAssert isNegative()
Short
is negative.
isNegative
in interface NumberAssert
AssertionError
- if the actual Short
is not negative.public ShortAssert 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<Short>
message
- the given error message, which will replace the default one.
public ShortAssert satisfies(Condition<Short> condition)
Short
satisfies the given condition.
satisfies
in class GenericAssert<Short>
condition
- the given condition.
NullPointerException
- if the given condition is null
.
AssertionError
- if the actual Short
does not satisfy the given condition.is(Condition)
public ShortAssert doesNotSatisfy(Condition<Short> condition)
Short
does not satisfy the given condition.
doesNotSatisfy
in class GenericAssert<Short>
condition
- the given condition.
NullPointerException
- if the given condition is null
.
AssertionError
- if the actual value does satisfies the given condition.isNot(Condition)
public ShortAssert is(Condition<Short> condition)
satisfies(Condition)
.
is
in class GenericAssert<Short>
condition
- the given condition.
NullPointerException
- if the given condition is null
.
AssertionError
- if the actual Short
does not satisfy the given condition.public ShortAssert isNot(Condition<Short> condition)
doesNotSatisfy(Condition)
.
isNot
in class GenericAssert<Short>
condition
- the given condition.
NullPointerException
- if the given condition is null
.
AssertionError
- if the actual Short
does not satisfy the given condition.public ShortAssert isNotNull()
Short
is not null
.
isNotNull
in class GenericAssert<Short>
AssertionError
- if the actual Short
is null
.public ShortAssert isSameAs(Short expected)
Short
is the same object as the given one.
isSameAs
in class GenericAssert<Short>
expected
- the given value to compare the actual Short
to.
AssertionError
- if the actual Short
is not the same as the given one.public ShortAssert isNotSameAs(Short other)
Short
is not the same object as the given one.
isNotSameAs
in class GenericAssert<Short>
other
- the given value to compare the actual BigDecimal
to.
AssertionError
- if the actual Short
is the same as the given one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |