Class IntegerSubject

    • Constructor Detail

      • IntegerSubject

        protected IntegerSubject​(FailureMetadata metadata,
                                 @Nullable Integer actual)
        The constructor is for use by subclasses only. If you want to create an instance of this class itself, call check(...).that(actual).
    • Method Detail

      • isWithin

        public IntegerSubject.TolerantIntegerComparison isWithin​(int tolerance)
        Prepares for a check that the actual value is a number within the given tolerance of an expected value that will be provided in the next call in the fluent chain.
        Parameters:
        tolerance - an inclusive upper bound on the difference between the actual value and expected value allowed by the check, which must be a non-negative value.
        Since:
        1.2
      • isNotWithin

        public IntegerSubject.TolerantIntegerComparison isNotWithin​(int tolerance)
        Prepares for a check that the actual value is a number not within the given tolerance of an expected value that will be provided in the next call in the fluent chain.
        Parameters:
        tolerance - an exclusive lower bound on the difference between the actual value and expected value allowed by the check, which must be a non-negative value.
        Since:
        1.2