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
Wrapper over
ComparableSubject
.
- Since:
- 1.0
- Author:
- Iulian Andrei (iulian.andrei@qaitsolutions.com)
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionComparableSubject
(T actual, String message) Constructor for regular assertions.ComparableSubject
(T actual, String message, ErrorTracker tracker) Constructor for soft assertions. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Checks that the subject is less than or equal toother
.final void
Checks that the subject is less than or equal toother
.void
isEquivalentAccordingToCompareTo
(T expected) Checks that the subject is equivalent toother
according toComparable.compareTo(T)
.final void
isGreaterThan
(T other) Checks that the subject is greater thanother
.final void
Checks that the subject is in range.final void
isLessThan
(T other) Checks that the subject is less thanother
.final void
Checks that the subject is not in range.Methods inherited from class com.qaitsolutions.pframe.core.assertion.subjects.Subject
isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs
-
Constructor Details
-
ComparableSubject
Constructor for regular assertions.- Parameters:
actual
- Current value to be verified.message
- Description of the assertion.
-
ComparableSubject
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
Checks that the subject is in range. Wrapper overComparableSubject.isIn(Range)
.- Parameters:
range
- Value to be verified against.
-
isNotIn
Checks that the subject is not in range. Wrapper overComparableSubject.isNotIn(Range)
.- Parameters:
range
- Value to be verified against.
-
isEquivalentAccordingToCompareTo
Checks that the subject is equivalent toother
according toComparable.compareTo(T)
. Wrapper overComparableSubject.isEquivalentAccordingToCompareTo(Comparable)
.- Parameters:
expected
- Value to be verified against.
-
isGreaterThan
Checks that the subject is greater thanother
. Wrapper overComparableSubject.isGreaterThan(Comparable)
.- Parameters:
other
- Value to be verified against.
-
isLessThan
Checks that the subject is less thanother
. Wrapper overComparableSubject.isLessThan(Comparable)
.- Parameters:
other
- Value to be verified against.
-
isAtMost
Checks that the subject is less than or equal toother
. Wrapper overComparableSubject.isAtMost(Comparable)
.- Parameters:
other
- Value to be verified against.
-
isAtLeast
Checks that the subject is less than or equal toother
. Wrapper overComparableSubject.isAtLeast(Comparable)
.- Parameters:
other
- Value to be verified against.
-