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