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 providedOptionalDoubleis empty so it doesn't have the expected value.shouldHaveValueCloseToPercentage(OptionalDouble actual, double expectedValue, Percentage percentage) Indicates that the providedOptionalDoublehas a value, but it is not within the given positive percentage.shouldHaveValueCloseToPercentage(OptionalDouble optional, double expectedValue, Percentage percentage, double difference) Deprecated.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 providedOptionalDoubleis 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 actual, double expectedValue, Percentage percentage) Indicates that the providedOptionalDoublehas a value, but it is not within the given positive percentage.- Parameters:
actual- theOptionalDoublewhich has a valueexpectedValue- the value we expect to be in the providedOptionalDoublepercentage- the given positive percentage- Returns:
- an error message factory
-
shouldHaveValueCloseToPercentage
@Deprecated public static OptionalDoubleShouldHaveValueCloseToPercentage shouldHaveValueCloseToPercentage(OptionalDouble optional, double expectedValue, Percentage percentage, double difference) Deprecated.useshouldHaveValueCloseToPercentage(OptionalDouble, double, Percentage)instead.Indicates that the provided
OptionalDoublehas a value, but it is not within the given positive percentage.- Parameters:
optional- theOptionalDoublewhich has a valueexpectedValue- the value we expect to be in the providedOptionalDoublepercentage- the given positive percentagedifference- the effective distance between actual and expected- Returns:
- an error message factory
-
shouldHaveValueCloseToPercentage(OptionalDouble, double, Percentage)instead.