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 ofComparablethis template can verify.
- Direct Known Subclasses:
BigDecimalAssert
Understands a template for assertion methods, applicable to
Comparables.-
Field Summary
Fields inherited from class org.fest.assertions.GenericAssert
actual -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComparableAssert(T actual) Creates a newComparableAssert. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidassertIsEqualByComparingTo(T expected) Verifies that the actualis equal to the given one.Comparableprotected final voidassertIsGreaterThan(T other) Verifies that the actualis greater than the given one.Comparableprotected final voidassertIsGreaterThanOrEqualTo(T other) Verifies that the actualis greater than or equal to the given one.Comparableprotected final voidassertIsLessThan(T other) Verifies that the actualis less than the given one.Comparableprotected final voidassertIsLessThanOrEqualTo(T other) Verifies that the actualis less than or equal to the given one.Comparableprotected final voidassertIsNotEqualByComparingTo(T expected) Verifies that the actualis not equal to the given one.Comparableprotected abstract ComparableAssert<T>isEqualByComparingTo(T expected) Verifies that the actualis equal to the given one.Comparableprotected abstract ComparableAssert<T>isGreaterThan(T other) Verifies that the actualis greater than the given one.Comparableprotected abstract ComparableAssert<T>isGreaterThanOrEqualTo(T other) Verifies that the actualis greater than or equal to the given one.Comparableprotected abstract ComparableAssert<T>isLessThan(T other) Verifies that the actualis less than the given one.Comparableprotected abstract ComparableAssert<T>isLessThanOrEqualTo(T other) Verifies that the actualis less than or equal to the given one.Comparableprotected abstract ComparableAssert<T>isNotEqualByComparingTo(T expected) Verifies that the actualis not equal to the given one.ComparableMethods 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, satisfiesMethods 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 actualis equal to the given one.Comparable- Parameters:
expected- the givenComparableto compare the actualComparableto.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not equal to the given one.
-
isNotEqualByComparingTo
Verifies that the actualis not equal to the given one.Comparable- Parameters:
expected- the givenComparableto use to compare to the actualComparable.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis equal to the given one.
-
isLessThan
Verifies that the actualis less than the given one.Comparable- Parameters:
other- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not less than the given one.
-
isGreaterThan
Verifies that the actualis greater than the given one.Comparable- Parameters:
other- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not greater than the given one.
-
isLessThanOrEqualTo
Verifies that the actualis less than or equal to the given one.Comparable- Parameters:
other- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not less than or equal to the given one.
-
isGreaterThanOrEqualTo
Verifies that the actualis greater than or equal to the given one.Comparable- Parameters:
other- the given value.- Returns:
- this assertion object.
- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not greater than or equal to the given one.
-
assertIsEqualByComparingTo
Verifies that the actualis equal to the given one.Comparable- Parameters:
expected- the givenComparableto compare the actualComparableto.- Throws:
AssertionError- if the actualComparablevalue isnull.AssertionError- if the actualComparablevalue is not equal to the given one.
-
assertIsNotEqualByComparingTo
Verifies that the actualis not equal to the given one.Comparable- Parameters:
expected- the givenComparableto use to compare to the actualComparable.- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis equal to the given one.
-
assertIsLessThan
Verifies that the actualis less than the given one.Comparable- Parameters:
other- the given value.- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not less than the given one.
-
assertIsGreaterThan
Verifies that the actualis greater than the given one.Comparable- Parameters:
other- the given value.- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not greater than the given one.
-
assertIsLessThanOrEqualTo
Verifies that the actualis less than or equal to the given one.Comparable- Parameters:
other- the given value.- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not less than or equal to the given one.
-
assertIsGreaterThanOrEqualTo
Verifies that the actualis greater than or equal to the given one.Comparable- Parameters:
other- the given value.- Throws:
AssertionError- if the actualComparableisnull.AssertionError- if the actualComparableis not greater than or equal to the given one.
-