Package org.fest.assertions
Class FloatArrayAssert
java.lang.Object
org.fest.assertions.Assert
org.fest.assertions.GenericAssert<T>
org.fest.assertions.GroupAssert<T>
org.fest.assertions.ItemGroupAssert<T>
org.fest.assertions.ArrayAssert<float[]>
org.fest.assertions.FloatArrayAssert
Understands assertion methods for
float arrays. To create a new instance of this class use the
method Assertions.assertThat(float[]).-
Field Summary
Fields inherited from class org.fest.assertions.GenericAssert
actual -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFloatArrayAssert(float... actual) Creates a newFloatArrayAssert. -
Method Summary
Modifier and TypeMethodDescriptionSets the description of the actual value, to be used in as message of anythrown when an assertion fails.AssertionErroras(Description description) Sets the description of the actual value, to be used in as message of anythrown when an assertion fails.AssertionErrorcontains(float... values) Verifies that the actualfloatarray contains the given values.containsOnly(float... values) Verifies that the actualfloatarray contains the given values only.describedAs(String description) Alias for, since "as" is a keyword in Groovy.GenericAssert.as(String)describedAs(Description description) Alias for, since "as" is a keyword in Groovy.GenericAssert.as(Description)doesNotSatisfy(Condition<float[]> condition) Verifies that the actualfloatarray does not satisfy the given condition.excludes(float... values) Verifies that the actualfloatarray does not contain the given values.hasSize(int expected) Verifies that the number of elements in the actualfloatarray is equal to the given one.Alias for.satisfies(Condition)isEqualTo(float[] expected) Verifies that the actualfloatarray is equal to the given array.Alias for.doesNotSatisfy(Condition)Verifies that the actualfloatarray contains at least on element.isNotEqualTo(float[] array) Verifies that the actualfloatarray is not equal to the given array.Verifies that the actualfloatarray is notnull.isNotSameAs(float[] expected) Verifies that the actualfloatarray is not the same as the given array.isSameAs(float[] expected) Verifies that the actualfloatarray is the same as the given array.overridingErrorMessage(String message) Replaces the default message displayed in case of a failure with the given one.Verifies that the actualfloatarray satisfies the given condition.Methods inherited from class org.fest.assertions.ArrayAssert
actualAsList, actualAsSet, actualGroupSizeMethods inherited from class org.fest.assertions.ItemGroupAssert
assertContains, assertContainsOnly, assertDoesNotHaveDuplicates, assertExcludes, asSet, validateIsNotNullMethods inherited from class org.fest.assertions.GroupAssert
assertHasSize, assertIsNotEmpty, isEmpty, isNullOrEmptyMethods inherited from class org.fest.assertions.GenericAssert
assertDoesNotSatisfy, assertEqualTo, assertIs, assertIsNot, assertNotEqualTo, assertNotNull, assertNotSameAs, assertSameAs, assertSatisfies, isNullMethods inherited from class org.fest.assertions.Assert
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith
-
Constructor Details
-
FloatArrayAssert
protected FloatArrayAssert(float... actual) Creates a newFloatArrayAssert.- Parameters:
actual- the target to verify.
-
-
Method Details
-
as
Sets the description of the actual value, to be used in as message of anythrown when an assertion fails. This method should be called before any assertion method, otherwise any assertion failure will not show the provided description.AssertionErrorFor example:
assertThat(val).as("name").isEqualTo("Frodo");- Specified by:
asin classGroupAssert<float[]>- Parameters:
description- the description of the actual value.- Returns:
- this assertion object.
-
describedAs
Alias for, 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.GenericAssert.as(String)For example:
assertThat(val).describedAs("name").isEqualTo("Frodo");- Specified by:
describedAsin classGroupAssert<float[]>- Parameters:
description- the description of the actual value.- Returns:
- this assertion object.
-
as
Sets the description of the actual value, to be used in as message of anythrown when an assertion fails. This method should be called before any assertion method, otherwise any assertion failure will not show the provided description.AssertionErrorFor example:
assertThat(val).as(new BasicDescription("name")).isEqualTo("Frodo");- Specified by:
asin classGroupAssert<float[]>- Parameters:
description- the description of the actual value.- Returns:
- this assertion object.
-
describedAs
Alias for, 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.GenericAssert.as(Description)For example:
assertThat(val).describedAs(new BasicDescription("name")).isEqualTo("Frodo");- Specified by:
describedAsin classGroupAssert<float[]>- Parameters:
description- the description of the actual value.- Returns:
- this assertion object.
-
contains
Verifies that the actualfloatarray contains the given values.- Parameters:
values- the values to look for.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray isnull.NullPointerException- if the givenfloatarray isnull.AssertionError- if the actualfloatarray does not contain the given values.
-
containsOnly
Verifies that the actualfloatarray contains the given values only.- Parameters:
values- the values to look for.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray isnull.NullPointerException- if the givenfloatarray isnull.AssertionError- if the actualfloatarray does not contain the given objects, or if the actualfloatarray contains elements other than the ones specified.
-
excludes
Verifies that the actualfloatarray does not contain the given values.- Parameters:
values- the values the array should exclude.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray isnull.NullPointerException- if the givenfloatarray isnull.AssertionError- if the actualObjectarray contains any of the given values.
-
satisfies
Verifies that the actualfloatarray satisfies the given condition.- Specified by:
satisfiesin classGenericAssert<float[]>- Parameters:
condition- the given condition.- Returns:
- this assertion object.
- Throws:
NullPointerException- if the given condition isnull.AssertionError- if the actualfloatarray does not satisfy the given condition.- See Also:
-
doesNotSatisfy
Verifies that the actualfloatarray does not satisfy the given condition.- Specified by:
doesNotSatisfyin classGenericAssert<float[]>- Parameters:
condition- the given condition.- Returns:
- this assertion object.
- Throws:
NullPointerException- if the given condition isnull.AssertionError- if the actualfloatarray satisfies the given condition.- See Also:
-
is
Alias for.satisfies(Condition)- Specified by:
isin classGenericAssert<float[]>- Parameters:
condition- the given condition.- Returns:
- this assertion object.
- Throws:
NullPointerException- if the given condition isnull.AssertionError- if the actualfloatarray does not satisfy the given condition.- Since:
- 1.2
-
isNot
Alias for.doesNotSatisfy(Condition)- Specified by:
isNotin classGenericAssert<float[]>- Parameters:
condition- the given condition.- Returns:
- this assertion object.
- Throws:
NullPointerException- if the given condition isnull.AssertionError- if the actualfloatarray satisfies the given condition.- Since:
- 1.2
-
isNotNull
Verifies that the actualfloatarray is notnull.- Specified by:
isNotNullin classGenericAssert<float[]>- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray isnull.
-
isNotEmpty
Verifies that the actualfloatarray contains at least on element.- Specified by:
isNotEmptyin classGroupAssert<float[]>- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray isnull.AssertionError- if the actualfloatarray is empty.
-
isEqualTo
Verifies that the actualfloatarray is equal to the given array. Array equality is checked by.Arrays.equals(float[], float[])- Specified by:
isEqualToin classGenericAssert<float[]>- Parameters:
expected- the given array to compare the actual array to.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray is not equal to the given one.
-
isNotEqualTo
Verifies that the actualfloatarray is not equal to the given array. Array equality is checked by.Arrays.equals(float[], float[])- Specified by:
isNotEqualToin classGenericAssert<float[]>- Parameters:
array- the given array to compare the actual array to.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray is equal to the given one.
-
hasSize
Verifies that the number of elements in the actualfloatarray is equal to the given one.- Specified by:
hasSizein classGroupAssert<float[]>- Parameters:
expected- the expected number of elements in the actualfloatarray.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray isnull.AssertionError- if the number of elements in the actualfloatarray is not equal to the given one.
-
isSameAs
Verifies that the actualfloatarray is the same as the given array.- Specified by:
isSameAsin classGenericAssert<float[]>- Parameters:
expected- the given array to compare the actual array to.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray is not the same as the given one.
-
isNotSameAs
Verifies that the actualfloatarray is not the same as the given array.- Specified by:
isNotSameAsin classGenericAssert<float[]>- Parameters:
expected- the given array to compare the actual array to.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualfloatarray is the same as the given one.
-
overridingErrorMessage
Replaces the default message displayed in case of a failure with the given one.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'".- Specified by:
overridingErrorMessagein classGroupAssert<float[]>- Parameters:
message- the given error message, which will replace the default one.- Returns:
- this assertion.
-