Class ShouldBeEqualWithinOffset

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldBeEqualWithinOffset
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies that two numbers are equal within a positive offset failed.
    Author:
    Alex Ruiz, Joel Costigliola
    • Constructor Detail

      • ShouldBeEqualWithinOffset

        private ShouldBeEqualWithinOffset​(Number actual,
                                          Number expected,
                                          Offset<T> offset,
                                          Number difference)
    • Method Detail

      • shouldBeEqual

        public static <T extends NumberErrorMessageFactory shouldBeEqual​(T actual,
                                                                           T expected,
                                                                           Offset<T> offset,
                                                                           T difference)
        Type Parameters:
        T - guarantees that the values used in this factory have the same type.
        Parameters:
        actual - the actual value in the failed assertion.
        expected - the expected value in the failed assertion.
        offset - the given positive offset.
        difference - the effective difference between actual and expected.
        Returns:
        the created ErrorMessageFactory.