Class OptionalDoubleShouldHaveValueCloseToPercentage

java.lang.Object
org.assertj.core.error.BasicErrorMessageFactory
org.assertj.core.error.OptionalDoubleShouldHaveValueCloseToPercentage
All Implemented Interfaces:
ErrorMessageFactory

public class OptionalDoubleShouldHaveValueCloseToPercentage extends BasicErrorMessageFactory
Build error message when an OptionalDouble should be close to an expected value within a positive percentage.
Author:
Joshua Kitchen
  • Method Details

    • shouldHaveValueCloseToPercentage

      public static OptionalDoubleShouldHaveValueCloseToPercentage shouldHaveValueCloseToPercentage(double expectedValue)
      Indicates that the provided OptionalDouble is empty so it doesn't have the expected value.
      Parameters:
      expectedValue - the value we expect to be in an OptionalDouble.
      Returns:
      a error message factory.
    • shouldHaveValueCloseToPercentage

      public static OptionalDoubleShouldHaveValueCloseToPercentage shouldHaveValueCloseToPercentage(OptionalDouble optional, double expectedValue, Percentage percentage, double difference)
      Indicates that the provided OptionalDouble has a value, but it is not within the given positive percentage.
      Parameters:
      optional - the OptionalDouble which has a value
      expectedValue - the value we expect to be in the provided OptionalDouble
      percentage - the given positive percentage
      difference - the effective distance between actual and expected
      Returns:
      an error message factory