Class Doubles


  • public class Doubles
    extends RealNumbers<java.lang.Double>
    Reusable assertions for Doubles.
    Author:
    Alex Ruiz, Joel Costigliola
    • Method Detail

      • zero

        protected java.lang.Double zero()
        Specified by:
        zero in class Numbers<java.lang.Double>
      • NaN

        protected java.lang.Double NaN()
        Specified by:
        NaN in class RealNumbers<java.lang.Double>
      • assertEqual

        public void assertEqual​(AssertionInfo info,
                                java.lang.Double actual,
                                java.lang.Double expected,
                                Offset<java.lang.Double> offset)
        Verifies that two floats are equal within a positive offset.
        It does not rely on the custom comparisonStrategy (if one is set) because using an offset is already a specific comparison strategy.
        Parameters:
        info - contains information about the assertion.
        actual - the actual value.
        expected - the expected value.
        offset - the given positive offset.
        Throws:
        java.lang.NullPointerException - if the given offset is null.
        java.lang.AssertionError - if the actual value is null.
        java.lang.AssertionError - if the actual value is not equal to the expected one.
      • isEqualTo

        protected boolean isEqualTo​(java.lang.Double actual,
                                    java.lang.Double expected,
                                    Offset<?> offset)
        Description copied from class: RealNumbers
        Returns true if the two floats parameter are equal within a positive offset, false otherwise.
        It does not rely on the custom comparisonStrategy (if one is set) because using an offset is already a specific comparison strategy.
        Specified by:
        isEqualTo in class RealNumbers<java.lang.Double>
        Parameters:
        actual - the actual value.
        expected - the expected value.
        offset - the given positive offset.
        Returns:
        true if the two floats parameter are equal within a positive offset, false otherwise.