public abstract class AbstractOptionalDoubleAssert<SELF extends AbstractOptionalDoubleAssert<SELF>> extends AbstractAssert<SELF,java.util.OptionalDouble>
OptionalDouble.| Modifier and Type | Field and Description |
|---|---|
(package private) Doubles |
doubles |
actual, conditions, info, myself, objects| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOptionalDoubleAssert(java.util.OptionalDouble actual,
java.lang.Class<?> selfType) |
| Modifier and Type | Method and Description |
|---|---|
SELF |
hasValue(double expectedValue)
Verifies that the actual
OptionalDouble has the value in argument. |
SELF |
hasValueCloseTo(java.lang.Double expectedValue,
Offset<java.lang.Double> offset)
Verifies that the actual
OptionalDouble has the value close to the argument. |
SELF |
isEmpty()
Verifies that the actual
OptionalDouble is empty. |
SELF |
isNotEmpty()
Verifies that there is a value present in the actual
OptionalDouble, it's an alias of isPresent(). |
SELF |
isNotPresent()
Verifies that the actual
Optional is empty (alias of isEmpty()). |
SELF |
isPresent()
Verifies that there is a value present in the actual
OptionalDouble. |
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, withThreadDumpOnErrorDoubles doubles
protected AbstractOptionalDoubleAssert(java.util.OptionalDouble actual,
java.lang.Class<?> selfType)
public SELF isPresent()
OptionalDouble.
Assertion will pass :
assertThat(OptionalDouble.of(10.0)).isPresent();
Assertion will fail :
assertThat(OptionalDouble.empty()).isPresent();java.lang.AssertionError - if actual value is empty.java.lang.AssertionError - if actual is null.public SELF isNotPresent()
Optional is empty (alias of isEmpty()).
Assertion will pass :
assertThat(OptionalDouble.empty()).isNotPresent();
Assertion will fail :
assertThat(OptionalDouble.of(10.0)).isNotPresent();public SELF isEmpty()
OptionalDouble is empty.
Assertion will pass :
assertThat(OptionalDouble.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalDouble.of(10.0)).isEmpty();java.lang.AssertionError - if actual value is present.java.lang.AssertionError - if actual is null.public SELF isNotEmpty()
OptionalDouble, it's an alias of isPresent().
Assertion will pass :
assertThat(OptionalDouble.of(10.0)).isNotEmpty();
Assertion will fail :
assertThat(OptionalDouble.empty()).isNotEmpty();java.lang.AssertionError - if actual value is empty.java.lang.AssertionError - if actual is null.public SELF hasValue(double expectedValue)
OptionalDouble 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);expectedValue - the expected value inside the OptionalDouble.java.lang.AssertionError - if actual value is empty.java.lang.AssertionError - if actual is null.java.lang.AssertionError - if actual has not the value as expected.public SELF hasValueCloseTo(java.lang.Double expectedValue, Offset<java.lang.Double> offset)
OptionalDouble 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));expectedValue - the expected value inside the OptionalDouble.offset - the given positive offset.java.lang.AssertionError - if actual value is empty.java.lang.AssertionError - if actual is null.java.lang.AssertionError - if actual has not the value as expected.java.lang.NullPointerException - if offset is nulljava.lang.IllegalArgumentException - if offset is not positive.