public final class SortedSetSubject extends IterableSubject
SortedSet
and NavigableSet
objects. This class supports assertions
based on NavigableSet
's API even if the subject only implements SortedSet
.IterableSubject.UsingCorrespondence<A,E>
failureStrategy
Modifier and Type | Method and Description |
---|---|
void |
hasFirstElement(Object element)
Fails if the subject does not have the given first element.
|
void |
hasLastElement(Object element)
Fails if the subject does not have the given last element.
|
SortedSetSubject |
named(String format,
Object... args)
Adds a prefix to the subject, when it is displayed in error messages.
|
comparingElementsUsing, contains, containsAllIn, containsAllOf, containsAnyIn, containsAnyOf, containsExactly, containsExactlyElementsIn, containsNoDuplicates, containsNoneIn, containsNoneOf, doesNotContain, failWithBadResultsAndSuffix, hasSize, isEmpty, isNotEmpty, isOrdered, isOrdered, isPartiallyOrdered, isPartiallyOrdered, isStrictlyOrdered, isStrictlyOrdered
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs
public SortedSetSubject named(String format, Object... args)
Subject
toString()
representation, e.g. boolean.
Writing assertThat(foo).named("foo").isTrue();
then results in a more reasonable error
message.
named()
takes a format template and argument objects which will be substituted into
the template, similar to String.format(String, Object...)
, the chief difference being
that extra parameters (for which there are no template variables) will be appended to the
resulting string in brackets. Additionally, this only supports the %s
template variable
type.
named
in class Subject<IterableSubject,Iterable<?>>
public void hasFirstElement(@Nullable Object element)
Copyright © 2017. All rights reserved.