Class RangeAssert<C extends Comparable<? super C>>
java.lang.Object
org.assertj.core.api.AbstractAssert<RangeAssert<C>, Range<C>>
be.imgn.gaia.core.testing.RangeAssert<C>
- Type Parameters:
C- the type of the values
- All Implemented Interfaces:
org.assertj.core.api.Assert<RangeAssert<C>, Range<C>>, org.assertj.core.api.Descriptable<RangeAssert<C>>, org.assertj.core.api.ExtensionPoints<RangeAssert<C>, Range<C>>
public final class RangeAssert<C extends Comparable<? super C>>
extends org.assertj.core.api.AbstractAssert<RangeAssert<C>, Range<C>>
AssertJ assertions on a
Range.
assertThat(Range.closedOpen(0, 10)).contains(0, 9).doesNotContain(10).encloses(Range.closed(2, 5));
- Since:
- 0.1.2
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends Comparable<? super C>>
RangeAssert<C> assertThat(@Nullable Range<C> actual) Returns assertions on a range.final RangeAssert<C> Verifies that the range contains all the given values.final RangeAssert<C> doesNotContain(C... values) Verifies that the range contains none of the given values.doesNotEnclose(Range<C> other) Verifies that the range does not enclose another one.Verifies that the range encloses another one.isConnectedTo(Range<C> other) Verifies that the range is connected to another one: that they overlap or are adjacent.isEmpty()Verifies that the range is empty, as[3, 3)is.isNotConnectedTo(Range<C> other) Verifies that the range is not connected to another one: that some value lies between them.Verifies that the range is not empty.Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
Method Details
-
assertThat
public static <C extends Comparable<? super C>> RangeAssert<C> assertThat(@Nullable Range<C> actual) Returns assertions on a range.- Type Parameters:
C- the type of the values- Parameters:
actual- the range; like any AssertJ assertion, every assertion fails if it isnull- Returns:
- the assertions
-
contains
Verifies that the range contains all the given values.- Parameters:
values- the values- Returns:
- these assertions
- Throws:
IllegalArgumentException- if no value is given, which would check nothing
-
doesNotContain
Verifies that the range contains none of the given values.- Parameters:
values- the values- Returns:
- these assertions
- Throws:
IllegalArgumentException- if no value is given, which would check nothing
-
isEmpty
Verifies that the range is empty, as[3, 3)is.- Returns:
- these assertions
-
isNotEmpty
-
encloses
Verifies that the range encloses another one.- Parameters:
other- the other range- Returns:
- these assertions
- See Also:
-
doesNotEnclose
Verifies that the range does not enclose another one.- Parameters:
other- the other range- Returns:
- these assertions
- See Also:
-
isConnectedTo
Verifies that the range is connected to another one: that they overlap or are adjacent.- Parameters:
other- the other range- Returns:
- these assertions
- See Also:
-
isNotConnectedTo
Verifies that the range is not connected to another one: that some value lies between them.- Parameters:
other- the other range- Returns:
- these assertions
- See Also:
-