public abstract class ComparableSubject<S extends ComparableSubject<S,T>,T extends Comparable> extends Subject<S,T>
Comparable
typed subjects.failureStrategy
Modifier | Constructor and Description |
---|---|
protected |
ComparableSubject(FailureMetadata metadata,
T actual) |
protected |
ComparableSubject(FailureStrategy failureStrategy,
T actual)
Deprecated.
Switch your
Subject from accepting FailureStrategy (and exposing a
SubjectFactory ) to accepting a FailureMetadata (and exposing a Subject.Factory ), at which point you'll call the FailureMetadata overload of this
constructor instead. |
Modifier and Type | Method and Description |
---|---|
void |
comparesEqualTo(T other)
Deprecated.
Use
isEquivalentAccordingToCompareTo(T) instead. |
void |
isAtLeast(T other)
Fails if the subject is less than the given value.
|
void |
isAtMost(T other)
Fails if the subject is greater than the given value.
|
void |
isEquivalentAccordingToCompareTo(T other)
Fails if the subject is not equivalent to the given value according to
Comparable.compareTo(T) , (i.e., fails if a.comparesTo(b) != 0 ). |
void |
isGreaterThan(T other)
Fails if the subject is not greater than the given value.
|
void |
isIn(com.google.common.collect.Range<T> range)
Fails if the subject is not in the given range.
|
void |
isLessThan(T other)
Fails if the subject is not less than the given value.
|
void |
isNotIn(com.google.common.collect.Range<T> range)
Fails if the subject is in the given range.
|
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failComparing, failComparing, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getDisplaySubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named
@Deprecated protected ComparableSubject(FailureStrategy failureStrategy, @Nullable T actual)
Subject
from accepting FailureStrategy
(and exposing a
SubjectFactory
) to accepting a FailureMetadata
(and exposing a Subject.Factory
), at which point you'll call the FailureMetadata
overload of this
constructor instead.protected ComparableSubject(FailureMetadata metadata, @Nullable T actual)
public final void isIn(com.google.common.collect.Range<T> range)
public final void isNotIn(com.google.common.collect.Range<T> range)
public void isEquivalentAccordingToCompareTo(T other)
Comparable.compareTo(T)
, (i.e., fails if a.comparesTo(b) != 0
).
Note: Do not use this method for checking object equality. Instead, use Subject.isEqualTo(Object)
.
@Deprecated public void comparesEqualTo(T other)
isEquivalentAccordingToCompareTo(T)
instead.Comparable.compareTo(T)
, (i.e., fails if a.comparesTo(b) != 0
).
Note: Do not use this method for checking object equality. Instead, use Subject.isEqualTo(Object)
.
public final void isGreaterThan(T other)
public final void isLessThan(T other)
public final void isAtMost(T other)
public final void isAtLeast(T other)
Copyright © 2017. All rights reserved.