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