Class MultisetSubject
java.lang.Object
com.google.common.truth.Subject
com.google.common.truth.IterableSubject
com.google.common.truth.MultisetSubject
A subject for
Multiset values.-
Nested Class Summary
Nested classes/interfaces inherited from class IterableSubject
IterableSubject.UsingCorrespondence<A,E> Modifier and TypeClassDescriptionstatic classA partially specified check in which the actual elements (normally the elements of theIterableunder test) are compared to expected elements using aCorrespondence.Nested classes/interfaces inherited from class Subject
Subject.Factory<SubjectT,ActualT> -
Method Summary
Methods inherited from class IterableSubject
actualCustomStringRepresentation, comparingElementsUsing, contains, containsAnyIn, containsAnyIn, containsAnyOf, containsAtLeast, containsAtLeastElementsIn, containsAtLeastElementsIn, containsExactly, containsExactlyElementsIn, containsExactlyElementsIn, containsNoDuplicates, containsNoneIn, containsNoneIn, containsNoneOf, doesNotContain, formattingDiffsUsing, hasSize, isEmpty, isEqualTo, isInOrder, isInOrder, isInStrictOrder, isInStrictOrder, isNoneOf, isNotEmpty, isNotInModifier and TypeMethodDescriptionprotected StringReturns a string representation of the actual value for inclusion in failure messages.<A extends @Nullable Object, E extends @Nullable Object>
IterableSubject.UsingCorrespondence<A, E> comparingElementsUsing(Correspondence<? super A, ? super E> correspondence) Starts a method chain for a check in which the actual elements (i.e. the elements of theIterableunder test) are compared to expected elements using the givenCorrespondence.final voidChecks that the actual iterable contains the supplied item.final voidcontainsAnyIn(@Nullable Iterable<?> expected) Checks that the actual iterable contains at least one of the objects contained in the provided collection.final voidcontainsAnyIn(@Nullable Object @Nullable [] expected) Checks that the actual iterable contains at least one of the objects contained in the provided array.final voidChecks that the actual iterable contains at least one of the provided objects.final OrderedChecks that the actual iterable contains at least all the expected elements.final OrderedcontainsAtLeastElementsIn(@Nullable Iterable<?> expected) Checks that the actual iterable contains at least all the expected elements.final OrderedcontainsAtLeastElementsIn(@Nullable Object @Nullable [] expected) Checks that the actual iterable contains at least all the expected elements.final OrderedcontainsExactly(@Nullable Object... expected) Checks that the actual iterable contains exactly the provided objects.final OrderedcontainsExactlyElementsIn(@Nullable Iterable<?> expected) Checks that the actual iterable contains exactly the provided objects.final OrderedcontainsExactlyElementsIn(@Nullable Object @Nullable [] expected) Checks that the actual iterable contains exactly the provided objects.final voidChecks that the actual iterable does not contain duplicate elements.final voidcontainsNoneIn(@Nullable Iterable<?> excluded) Checks that the actual iterable contains none of the elements contained in the excluded iterable.final voidcontainsNoneIn(@Nullable Object @Nullable [] excluded) Checks that the actual iterable contains none of the elements contained in the excluded array.final voidChecks that the actual iterable contains none of the excluded objects.final voiddoesNotContain(@Nullable Object element) Checks that the actual iterable does not contain the supplied item.<T extends @Nullable Object>
IterableSubject.UsingCorrespondence<T, T> formattingDiffsUsing(Correspondence.DiffFormatter<? super T, ? super T> formatter) Starts a method chain for a check in which failure messages may use the givenCorrespondence.DiffFormatterto describe the difference between an actual element (i.e. an element of theIterableunder test) and the element it is expected to be equal to, but isn't.final voidhasSize(int size) Checks that the actual iterable has the given size.final voidisEmpty()Checks that the actual iterable is empty.voidChecks that the value under test is equal to the given object.voidChecks that the actual iterable is ordered, according to the natural ordering of its elements.final voidisInOrder(@Nullable Comparator<?> comparator) Checks that the actual iterable is ordered, according to the given comparator.voidChecks that the actual iterable is strictly ordered, according to the natural ordering of its elements.final voidisInStrictOrder(@Nullable Comparator<?> comparator) Checks that the actual iterable is strictly ordered, according to the given comparator.voidDeprecated.final voidChecks that the actual iterable is not empty.voidDeprecated.You probably meant to callIterableSubject.containsNoneIn(Iterable)instead.Methods inherited from class Subject
check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isIn, isInstanceOf, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toStringModifier and TypeMethodDescriptionprotected final StandardSubjectBuilderReturns a builder for creating a derived subject.final booleanDeprecated.Object.equals(Object)is not supported on Truth subjects.protected final voidfailWithActual(Fact first, Fact... rest) Fails, reporting a message with the given facts, followed by an automatically added fact of the form: but was: actual value.protected final voidfailWithActual(String key, @Nullable Object value) Fails, reporting a message with two "facts": key: value but was: actual value.protected final voidfailWithoutActual(Fact first, Fact... rest) Fails, reporting a message with the given facts, without automatically adding the actual value.final inthashCode()Deprecated.Object.hashCode()is not supported on Truth subjects.protected final StandardSubjectBuilderBegins a new call chain that ignores any failures.voidChecks that the value under test is equal to any of the given elements.voidChecks that the value under test is equal to any element in the given iterable.voidisInstanceOf(@Nullable Class<?> clazz) Checks that the value under test is an instance of the given class.voidisNotEqualTo(@Nullable Object other) Checks that the value under test is not equal to the given object.voidisNotInstanceOf(@Nullable Class<?> clazz) Checks that the value under test is not an instance of the given class.voidChecks that the value under test is not null.final voidisNotSameInstanceAs(@Nullable Object other) Checks that the value under test is not the same instance as the given object.voidisNull()Checks that the value under test is null.final voidisSameInstanceAs(@Nullable Object expected) Checks that the value under test is the same instance as the given object.toString()Deprecated.Object.toString()is not supported on Truth subjects.
-
Method Details
-
hasCount
-
IterableSubject.containsNoneOf(Object, Object, Object...)instead.