Package org.assertj.core.api
Class AbstractOptionalDoubleAssert<SELF extends AbstractOptionalDoubleAssert<SELF>>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,OptionalDouble>
org.assertj.core.api.AbstractOptionalDoubleAssert<SELF>
- All Implemented Interfaces:
Assert<SELF,
,OptionalDouble> Descriptable<SELF>
,ExtensionPoints<SELF,
OptionalDouble>
- Direct Known Subclasses:
OptionalDoubleAssert
public abstract class AbstractOptionalDoubleAssert<SELF extends AbstractOptionalDoubleAssert<SELF>>
extends AbstractAssert<SELF,OptionalDouble>
Assertions for
OptionalDouble
.-
Field Summary
FieldsFields inherited from class org.assertj.core.api.AbstractAssert
actual, conditions, info, myself, objects
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractOptionalDoubleAssert
(OptionalDouble actual, Class<?> selfType) -
Method Summary
Modifier and TypeMethodDescriptionhasValue
(double expectedValue) Verifies that the actualOptionalDouble
has the value in argument.hasValueCloseTo
(Double expectedValue, Offset<Double> offset) Verifies that the actualOptionalDouble
has the value close to the argument.isEmpty()
Verifies that the actualOptionalDouble
is empty.Verifies that there is a value present in the actualOptionalDouble
, it's an alias ofisPresent()
.Verifies that there is a value present in the actualOptionalDouble
.Methods inherited from class org.assertj.core.api.AbstractAssert
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
-
Field Details
-
doubles
Doubles doubles
-
-
Constructor Details
-
AbstractOptionalDoubleAssert
-
-
Method Details
-
isPresent
Verifies that there is a value present in the actualOptionalDouble
. Assertion will pass :assertThat(OptionalDouble.of(10.0)).isPresent();
Assertion will fail :
assertThat(OptionalDouble.empty()).isPresent();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.
-
isNotPresent
Verifies that the actualOptional
is empty (alias ofisEmpty()
). Assertion will pass :
Assertion will fail :assertThat(OptionalDouble.empty()).isNotPresent();
assertThat(OptionalDouble.of(10.0)).isNotPresent();
- Returns:
- this assertion object.
-
isEmpty
Verifies that the actualOptionalDouble
is empty. Assertion will pass :assertThat(OptionalDouble.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalDouble.of(10.0)).isEmpty();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is present.AssertionError
- if actual is null.
-
isNotEmpty
Verifies that there is a value present in the actualOptionalDouble
, it's an alias ofisPresent()
. Assertion will pass :assertThat(OptionalDouble.of(10.0)).isNotEmpty();
Assertion will fail :
assertThat(OptionalDouble.empty()).isNotEmpty();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.
-
hasValue
Verifies that the actualOptionalDouble
has the value in argument. Assertion will pass :assertThat(OptionalDouble.of(8.0)).hasValue(8.0); assertThat(OptionalDouble.of(8.0)).hasValue(Double.valueOf(8.0)); assertThat(OptionalDouble.of(Double.NaN)).hasValue(Double.NaN);
Assertion will fail :
assertThat(OptionalDouble.empty()).hasValue(8.0); assertThat(OptionalDouble.of(7)).hasValue(8.0);
- Parameters:
expectedValue
- the expected value inside theOptionalDouble
.- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.AssertionError
- if actual has not the value as expected.
-
hasValueCloseTo
Verifies that the actualOptionalDouble
has the value close to the argument. Assertion will pass :assertThat(OptionalDouble.of(8)).hasValueCloseTo(8.0, within(0d)); assertThat(OptionalDouble.of(8)).hasValueCloseTo(8.0, within(1d)); assertThat(OptionalDouble.of(7)).hasValueCloseTo(8.0, within(1d));
Assertion will fail :
assertThat(OptionalDouble.empty()).hasValueCloseTo(8.0, within(1d)); assertThat(OptionalDouble.of(7)).hasValueCloseTo(1.0, within(1d)); assertThat(OptionalDouble.of(7)).hasValueCloseTo(1.0, null); assertThat(OptionalDouble.of(7)).hasValueCloseTo(1.0, within(-1d));
- Parameters:
expectedValue
- the expected value inside theOptionalDouble
.offset
- the given positive offset.- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.AssertionError
- if actual has not the value as expected.NullPointerException
- if offset is nullIllegalArgumentException
- if offset is not positive.
-