Package org.assertj.core.error
Class OptionalDoubleShouldHaveValueCloseToPercentage
java.lang.Object
org.assertj.core.error.BasicErrorMessageFactory
org.assertj.core.error.OptionalDoubleShouldHaveValueCloseToPercentage
- All Implemented Interfaces:
ErrorMessageFactory
Build error message when an
OptionalDouble
should be close to an expected value within a positive
percentage.- Author:
- Joshua Kitchen
-
Field Summary
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format
-
Method Summary
Modifier and TypeMethodDescriptionshouldHaveValueCloseToPercentage
(double expectedValue) Indicates that the providedOptionalDouble
is empty so it doesn't have the expected value.shouldHaveValueCloseToPercentage
(OptionalDouble optional, double expectedValue, Percentage percentage, double difference) Indicates that the providedOptionalDouble
has a value, but it is not within the given positive percentage.Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
Method Details
-
shouldHaveValueCloseToPercentage
public static OptionalDoubleShouldHaveValueCloseToPercentage shouldHaveValueCloseToPercentage(double expectedValue) Indicates that the providedOptionalDouble
is empty so it doesn't have the expected value.- Parameters:
expectedValue
- the value we expect to be in anOptionalDouble
.- Returns:
- a error message factory.
-
shouldHaveValueCloseToPercentage
public static OptionalDoubleShouldHaveValueCloseToPercentage shouldHaveValueCloseToPercentage(OptionalDouble optional, double expectedValue, Percentage percentage, double difference) Indicates that the providedOptionalDouble
has a value, but it is not within the given positive percentage.- Parameters:
optional
- theOptionalDouble
which has a valueexpectedValue
- the value we expect to be in the providedOptionalDouble
percentage
- the given positive percentagedifference
- the effective distance between actual and expected- Returns:
- an error message factory
-