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 Type
    Method
    Description
    static <C extends Comparable<? super C>>
    RangeAssert<C>
    assertThat(@Nullable Range<C> actual)
    Returns assertions on a range.
    final RangeAssert<C>
    contains(C... values)
    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.
    Verifies that the range does not enclose another one.
    encloses(Range<C> other)
    Verifies that the range encloses another one.
    Verifies that the range is connected to another one: that they overlap or are adjacent.
    Verifies that the range is empty, as [3, 3) is.
    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, withThreadDumpOnError

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods 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 is null
      Returns:
      the assertions
    • contains

      @SafeVarargs public final RangeAssert<C> contains(C... values)
      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

      @SafeVarargs public final RangeAssert<C> doesNotContain(C... values)
      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

      public RangeAssert<C> isEmpty()
      Verifies that the range is empty, as [3, 3) is.
      Returns:
      these assertions
    • isNotEmpty

      public RangeAssert<C> isNotEmpty()
      Verifies that the range is not empty.
      Returns:
      these assertions
    • encloses

      public RangeAssert<C> encloses(Range<C> other)
      Verifies that the range encloses another one.
      Parameters:
      other - the other range
      Returns:
      these assertions
      See Also:
    • doesNotEnclose

      public RangeAssert<C> doesNotEnclose(Range<C> other)
      Verifies that the range does not enclose another one.
      Parameters:
      other - the other range
      Returns:
      these assertions
      See Also:
    • isConnectedTo

      public RangeAssert<C> isConnectedTo(Range<C> other)
      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

      public RangeAssert<C> isNotConnectedTo(Range<C> other)
      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: