|
||||||||||
| 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<T>
org.fest.assertions.GroupAssert<T>
org.fest.assertions.ArrayAssert<char[]>
org.fest.assertions.CharArrayAssert
public class CharArrayAssert
Understands assertion methods for char arrays. To create a new instance of this class use the
method .
Assertions.assertThat(char[])
| Field Summary |
|---|
| Fields inherited from class org.fest.assertions.GenericAssert |
|---|
actual |
| Constructor Summary | |
|---|---|
protected |
CharArrayAssert(char... actual)
Creates a new CharArrayAssert. |
| Method Summary | |
|---|---|
CharArrayAssert |
as(Description description)
Sets the description of the actual value, to be used in as message of any
thrown when an assertion fails. |
CharArrayAssert |
as(String description)
Sets the description of the actual value, to be used in as message of any
thrown when an assertion fails. |
CharArrayAssert |
contains(char... values)
Verifies that the actual char array contains the given values. |
CharArrayAssert |
containsOnly(char... values)
Verifies that the actual char array contains the given values only. |
CharArrayAssert |
describedAs(Description description)
Alias for , since "as" is a keyword in
Groovy. |
CharArrayAssert |
describedAs(String description)
Alias for , since "as" is a keyword in
Groovy. |
CharArrayAssert |
doesNotSatisfy(Condition<char[]> condition)
Verifies that the actual char array does not satisfy the given condition. |
CharArrayAssert |
excludes(char... values)
Verifies that the actual char array does not contain the given values. |
CharArrayAssert |
hasSize(int expected)
Verifies that the number of elements in the actual char array is equal to the given one. |
CharArrayAssert |
is(Condition<char[]> condition)
Alias for . |
CharArrayAssert |
isEqualTo(char[] expected)
Verifies that the actual char array is equal to the given array. |
CharArrayAssert |
isNot(Condition<char[]> condition)
Alias for . |
CharArrayAssert |
isNotEmpty()
Verifies that the actual char array contains at least on element. |
CharArrayAssert |
isNotEqualTo(char[] array)
Verifies that the actual char array is not equal to the given array. |
CharArrayAssert |
isNotNull()
Verifies that the actual char array is not null. |
CharArrayAssert |
isNotSameAs(char[] expected)
Verifies that the actual char array is not the same as the given array. |
CharArrayAssert |
isSameAs(char[] expected)
Verifies that the actual char array is the same as the given array. |
CharArrayAssert |
overridingErrorMessage(String message)
Replaces the default message displayed in case of a failure with the given one. |
CharArrayAssert |
satisfies(Condition<char[]> condition)
Verifies that the actual char array satisfies the given condition. |
| Methods inherited from class org.fest.assertions.ArrayAssert |
|---|
actualGroupSize, actualInBrackets, assertContains, assertContainsOnly, assertExcludes, assertThatActualHasSize, assertThatActualIsNotEmpty, assertThatActualIsNotNull, isEmpty, isNullOrEmpty |
| 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 CharArrayAssert(char... actual)
CharArrayAssert.
actual - the target to verify.| Method Detail |
|---|
public CharArrayAssert 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(values).as("Some values").isNotEmpty();
as in class GenericAssert<char[]>description - the description of the actual value.
public CharArrayAssert 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(values).describedAs("Some values").isNotEmpty();
describedAs in class GenericAssert<char[]>description - the description of the actual value.
public CharArrayAssert 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(values).as(new BasicDescription("Some values")).isNotEmpty();
as in class GenericAssert<char[]>description - the description of the actual value.
public CharArrayAssert 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(values).describedAs(new BasicDescription("Some values")).isNotEmpty();
describedAs in class GenericAssert<char[]>description - the description of the actual value.
public CharArrayAssert contains(char... values)
char array contains the given values.
values - the values to look for.
AssertionError - if the actual char array is null.
NullPointerException - if the given char array is null.
AssertionError - if the actual char array does not contain the given values.public CharArrayAssert containsOnly(char... values)
char array contains the given values only.
values - the values to look for.
AssertionError - if the actual char array is null.
NullPointerException - if the given char array is null.
AssertionError - if the actual char array does not contain the given objects, or if the actual
char array contains elements other than the ones specified.public CharArrayAssert excludes(char... values)
char array does not contain the given values.
values - the values the array should exclude.
AssertionError - if the actual char array is null.
NullPointerException - if the given char array is null.
AssertionError - if the actual char array contains any of the given values.public CharArrayAssert satisfies(Condition<char[]> condition)
char array satisfies the given condition.
satisfies in class GenericAssert<char[]>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual char array does not satisfy the given condition.is(Condition)public CharArrayAssert doesNotSatisfy(Condition<char[]> condition)
char array does not satisfy the given condition.
doesNotSatisfy in class GenericAssert<char[]>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual char array satisfies the given condition.isNot(Condition)public CharArrayAssert is(Condition<char[]> condition)
satisfies(Condition).
is in class GenericAssert<char[]>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual char array does not satisfy the given condition.public CharArrayAssert isNot(Condition<char[]> condition)
doesNotSatisfy(Condition).
isNot in class GenericAssert<char[]>condition - the given condition.
NullPointerException - if the given condition is null.
AssertionError - if the actual char array satisfies the given condition.public CharArrayAssert isNotNull()
char array is not null.
isNotNull in class GenericAssert<char[]>AssertionError - if the actual char array is null.public CharArrayAssert isNotEmpty()
char array contains at least on element.
isNotEmpty in class GroupAssert<char[]>AssertionError - if the actual char array is null.
AssertionError - if the actual char array is empty.public CharArrayAssert isEqualTo(char[] expected)
char array is equal to the given array. Array equality is checked by
Arrays.equals(char[], char[]).
isEqualTo in class GenericAssert<char[]>expected - the given array to compare the actual array to.
AssertionError - if the actual char array is not equal to the given one.public CharArrayAssert isNotEqualTo(char[] array)
char array is not equal to the given array. Array equality is checked by
Arrays.equals(char[], char[]).
isNotEqualTo in class GenericAssert<char[]>array - the given array to compare the actual array to.
AssertionError - if the actual char array is equal to the given one.public CharArrayAssert hasSize(int expected)
char array is equal to the given one.
hasSize in class GroupAssert<char[]>expected - the expected number of elements in the actual char array.
AssertionError - if the actual char array is null.
AssertionError - if the number of elements in the actual char array is not equal to the given
one.public CharArrayAssert isSameAs(char[] expected)
char array is the same as the given array.
isSameAs in class GenericAssert<char[]>expected - the given array to compare the actual array to.
AssertionError - if the actual char array is not the same as the given one.public CharArrayAssert isNotSameAs(char[] expected)
char array is not the same as the given array.
isNotSameAs in class GenericAssert<char[]>expected - the given array to compare the actual array to.
AssertionError - if the actual char array is the same as the given one.public CharArrayAssert 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<char[]>message - 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 | |||||||||