Class ComparableSubject<T extends Comparable>

java.lang.Object
com.qaitsolutions.pframe.core.assertion.subjects.Subject
com.qaitsolutions.pframe.core.assertion.subjects.ComparableSubject<T>
Direct Known Subclasses:
BigDecimalSubject, DoubleSubject, IntegerSubject, LongSubject, StringSubject

public class ComparableSubject<T extends Comparable> extends Subject
Wrapper over ComparableSubject.

Since:
1.0
Author:
Iulian Andrei (iulian.andrei@qaitsolutions.com)
  • Constructor Details

    • ComparableSubject

      public ComparableSubject(T actual, String message)
      Constructor for regular assertions.

      Parameters:
      actual - Current value to be verified.
      message - Description of the assertion.
    • ComparableSubject

      public ComparableSubject(T actual, String message, ErrorTracker tracker)
      Constructor for soft assertions.

      Parameters:
      actual - Current value to be verified.
      message - Description of the assertion.
      tracker - Entity which allows keeping track of existing errors.
  • Method Details

    • isIn

      public final void isIn(com.google.common.collect.Range<T> range)
      Checks that the subject is in range. Wrapper over ComparableSubject.isIn(Range).

      Parameters:
      range - Value to be verified against.
    • isNotIn

      public final void isNotIn(com.google.common.collect.Range<T> range)
      Checks that the subject is not in range. Wrapper over ComparableSubject.isNotIn(Range).

      Parameters:
      range - Value to be verified against.
    • isEquivalentAccordingToCompareTo

      public void isEquivalentAccordingToCompareTo(T expected)
      Checks that the subject is equivalent to other according to Comparable.compareTo(T). Wrapper over ComparableSubject.isEquivalentAccordingToCompareTo(Comparable).

      Parameters:
      expected - Value to be verified against.
    • isGreaterThan

      public final void isGreaterThan(T other)
      Checks that the subject is greater than other. Wrapper over ComparableSubject.isGreaterThan(Comparable).

      Parameters:
      other - Value to be verified against.
    • isLessThan

      public final void isLessThan(T other)
      Checks that the subject is less than other. Wrapper over ComparableSubject.isLessThan(Comparable).

      Parameters:
      other - Value to be verified against.
    • isAtMost

      public final void isAtMost(T other)
      Checks that the subject is less than or equal to other. Wrapper over ComparableSubject.isAtMost(Comparable).

      Parameters:
      other - Value to be verified against.
    • isAtLeast

      public final void isAtLeast(T other)
      Checks that the subject is less than or equal to other. Wrapper over ComparableSubject.isAtLeast(Comparable).

      Parameters:
      other - Value to be verified against.