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