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