Class ShouldBeEqualWithinPercentage

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldBeEqualWithinPercentage
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies that two numbers are equal within a positive percentage failed.
    Author:
    Alexander Bischof
    • Method Detail

      • shouldBeEqualWithinPercentage

        public static <T extends NumberErrorMessageFactory shouldBeEqualWithinPercentage​(T actual,
                                                                                           T expected,
                                                                                           Percentage percentage,
                                                                                           T difference)
        Parameters:
        actual - the actual value in the failed assertion.
        expected - the expected value in the failed assertion.
        percentage - the given positive percentage.
        difference - the effective difference between actual and expected.
        Returns:
        the created ErrorMessageFactory.