public final class OptionalDoubleSubject extends Subject<OptionalDoubleSubject,OptionalDouble>
OptionalDouble
subjects.Modifier and Type | Method and Description |
---|---|
void |
hasValue(double expected)
Fails if the
OptionalDouble does not have the given value or the subject is null. |
DoubleSubject |
hasValueThat()
Prepares for a check regarding the value contained within the
OptionalDouble . |
void |
isEmpty()
Fails if the
OptionalDouble is present or the subject is null. |
void |
isPresent()
Fails if the
OptionalDouble is empty or the subject is null. |
static Subject.Factory<OptionalDoubleSubject,OptionalDouble> |
optionalDoubles() |
actual, actualAsString, actualCustomStringRepresentation, check, check, equals, fail, fail, fail, failComparing, failComparing, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named, toString
public void isPresent()
OptionalDouble
is empty or the subject is null.public void isEmpty()
OptionalDouble
is present or the subject is null.public void hasValue(double expected)
OptionalDouble
does not have the given value or the subject is null. This
method is not recommended when the code under test is doing any kind of arithmetic,
since the exact result of floating point arithmetic is sensitive to apparently trivial changes.
More sophisticated comparisons can be done using hasValueThat()
. This method is
recommended when the code under test is specified as either copying a value without
modification from its input or returning a well-defined literal or constant value.public DoubleSubject hasValueThat()
OptionalDouble
. Fails
immediately if the subject is empty.public static Subject.Factory<OptionalDoubleSubject,OptionalDouble> optionalDoubles()
Copyright © 2018. All rights reserved.