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