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