Package org.fest.assertions
Class ComparableAssert<T extends Comparable<T>>
java.lang.Object
org.fest.assertions.Assert
org.fest.assertions.GenericAssert<T>
org.fest.assertions.ComparableAssert<T>
- Type Parameters:
T
- the type ofComparable
this template can verify.
- Direct Known Subclasses:
BigDecimalAssert
Understands a template for assertion methods, applicable to
Comparable
s.-
Field Summary
Fields inherited from class org.fest.assertions.GenericAssert
actual
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ComparableAssert
(T actual) Creates a newComparableAssert
. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
assertIsEqualByComparingTo
(T expected) Verifies that the actual
is equal to the given one.Comparable
protected final void
assertIsGreaterThan
(T other) Verifies that the actual
is greater than the given one.Comparable
protected final void
assertIsGreaterThanOrEqualTo
(T other) Verifies that the actual
is greater than or equal to the given one.Comparable
protected final void
assertIsLessThan
(T other) Verifies that the actual
is less than the given one.Comparable
protected final void
assertIsLessThanOrEqualTo
(T other) Verifies that the actual
is less than or equal to the given one.Comparable
protected final void
assertIsNotEqualByComparingTo
(T expected) Verifies that the actual
is not equal to the given one.Comparable
protected abstract ComparableAssert<T>
isEqualByComparingTo
(T expected) Verifies that the actual
is equal to the given one.Comparable
protected abstract ComparableAssert<T>
isGreaterThan
(T other) Verifies that the actual
is greater than the given one.Comparable
protected abstract ComparableAssert<T>
isGreaterThanOrEqualTo
(T other) Verifies that the actual
is greater than or equal to the given one.Comparable
protected abstract ComparableAssert<T>
isLessThan
(T other) Verifies that the actual
is less than the given one.Comparable
protected abstract ComparableAssert<T>
isLessThanOrEqualTo
(T other) Verifies that the actual
is less than or equal to the given one.Comparable
protected abstract ComparableAssert<T>
isNotEqualByComparingTo
(T expected) Verifies that the actual
is not equal to the given one.Comparable
Methods inherited from class org.fest.assertions.GenericAssert
as, as, assertDoesNotSatisfy, assertEqualTo, assertIs, assertIsNot, assertNotEqualTo, assertNotNull, assertNotSameAs, assertSameAs, assertSatisfies, describedAs, describedAs, doesNotSatisfy, is, isEqualTo, isNot, isNotEqualTo, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfies
Methods inherited from class org.fest.assertions.Assert
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith
-
Constructor Details
-
ComparableAssert
Creates a newComparableAssert
.- Parameters:
actual
- the target to verify.
-
-
Method Details
-
isEqualByComparingTo
Verifies that the actual
is equal to the given one.Comparable
- Parameters:
expected
- the givenComparable
to compare the actualComparable
to.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not equal to the given one.
-
isNotEqualByComparingTo
Verifies that the actual
is not equal to the given one.Comparable
- Parameters:
expected
- the givenComparable
to use to compare to the actualComparable
.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is equal to the given one.
-
isLessThan
Verifies that the actual
is less than the given one.Comparable
- Parameters:
other
- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not less than the given one.
-
isGreaterThan
Verifies that the actual
is greater than the given one.Comparable
- Parameters:
other
- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not greater than the given one.
-
isLessThanOrEqualTo
Verifies that the actual
is less than or equal to the given one.Comparable
- Parameters:
other
- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not less than or equal to the given one.
-
isGreaterThanOrEqualTo
Verifies that the actual
is greater than or equal to the given one.Comparable
- Parameters:
other
- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not greater than or equal to the given one.
-
assertIsEqualByComparingTo
Verifies that the actual
is equal to the given one.Comparable
- Parameters:
expected
- the givenComparable
to compare the actualComparable
to.- Throws:
AssertionError
- if the actualComparable
value isnull
.AssertionError
- if the actualComparable
value is not equal to the given one.
-
assertIsNotEqualByComparingTo
Verifies that the actual
is not equal to the given one.Comparable
- Parameters:
expected
- the givenComparable
to use to compare to the actualComparable
.- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is equal to the given one.
-
assertIsLessThan
Verifies that the actual
is less than the given one.Comparable
- Parameters:
other
- the given value.- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not less than the given one.
-
assertIsGreaterThan
Verifies that the actual
is greater than the given one.Comparable
- Parameters:
other
- the given value.- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not greater than the given one.
-
assertIsLessThanOrEqualTo
Verifies that the actual
is less than or equal to the given one.Comparable
- Parameters:
other
- the given value.- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not less than or equal to the given one.
-
assertIsGreaterThanOrEqualTo
Verifies that the actual
is greater than or equal to the given one.Comparable
- Parameters:
other
- the given value.- Throws:
AssertionError
- if the actualComparable
isnull
.AssertionError
- if the actualComparable
is not greater than or equal to the given one.
-