Package org.assertj.guava.api
Class MultisetAssert<T>
java.lang.Object
org.assertj.core.api.AbstractAssert<MultisetAssert<T>,Multiset<? extends T>>
org.assertj.core.api.AbstractIterableAssert<MultisetAssert<T>,Multiset<? extends T>,T,ObjectAssert<T>>
org.assertj.guava.api.MultisetAssert<T>
- Type Parameters:
T
- the type of elements contained in the tested Multiset value
- All Implemented Interfaces:
Assert<MultisetAssert<T>,
,Multiset<? extends T>> Descriptable<MultisetAssert<T>>
,EnumerableAssert<MultisetAssert<T>,
,T> ExtensionPoints<MultisetAssert<T>,
,Multiset<? extends T>> ObjectEnumerableAssert<MultisetAssert<T>,
T>
public class MultisetAssert<T>
extends AbstractIterableAssert<MultisetAssert<T>,Multiset<? extends T>,T,ObjectAssert<T>>
Assertions for guava
Multiset
.
To create an instance of this class, invoke Assertions.assertThat(Multiset)
- Author:
- Max Daniline
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractIterableAssert
iterables
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionVerifies the actualMultiset
contains the given value exactly the given number of times.containsAtLeast
(int minimumCount, T expected) Verifies the actualMultiset
contains the given value at least the given number of times.containsAtMost
(int maximumCount, T expected) Verifies the actualMultiset
contains the given value at most the given number of times.protected MultisetAssert
<T> newAbstractIterableAssert
(Iterable<? extends T> iterable) protected ObjectAssert
<T> Methods inherited from class org.assertj.core.api.AbstractIterableAssert
allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, as, as, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsAnyOfForProxy, containsExactly, containsExactlyElementsOf, containsExactlyForProxy, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsExactlyInAnyOrderForProxy, containsForProxy, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyForProxy, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsOnlyOnceForProxy, containsSequence, containsSequence, containsSequenceForProxy, containsSubsequence, containsSubsequence, containsSubsequenceForProxy, describedAs, describedAs, doesNotContain, doesNotContainAnyElementsOf, doesNotContainForProxy, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSequenceForProxy, doesNotContainSubsequence, doesNotContainSubsequence, doesNotContainSubsequenceForProxy, doesNotHave, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doesNotHaveSameClassAs, doNotHave, element, element, elements, endsWith, endsWith, endsWithForProxy, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOn, filteredOn, filteredOnAssertions, filteredOnAssertions, filteredOnNull, first, first, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtractingForProxy, flatMap, flatMap, flatMap, flatMap, getComparatorsByType, getComparatorsForElementPropertyOrFieldTypes, has, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameClassAs, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, hasToString, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, is, isEmpty, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEmpty, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNullOrEmpty, isOfAnyClassIn, isSameAs, isSubsetOf, isSubsetOf, isSubsetOfForProxy, last, last, map, map, map, navigationDescription, newAbstractIterableAssertForProxy, noneMatch, noneSatisfy, noneSatisfy, overridingErrorMessage, satisfiesExactly, satisfiesExactly, satisfiesExactlyForProxy, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrderForProxy, satisfiesOnlyOnce, satisfiesOnlyOnce, satisfiesOnlyOnceForProxy, singleElement, singleElement, size, startsWith, startsWithForProxy, usingComparator, usingComparator, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, withFailMessage, withThreadDumpOnError, zipSatisfy
Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, hasToString, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, withFailMessage, withRepresentation
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, describedAs
-
Constructor Details
-
MultisetAssert
-
-
Method Details
-
contains
Verifies the actualMultiset
contains the given value exactly the given number of times.Example :
Multiset<String> actual = HashMultiset.create(); actual.add("shoes", 2); // assertion succeeds assertThat(actual).contains(2, "shoes"); // assertions fail assertThat(actual).contains(1, "shoes"); assertThat(actual).contains(3, "shoes");
- Parameters:
expectedCount
- the exact number of times the given value should appear in the setexpected
- the value which to expect- Returns:
- this
MultisetAssert
for fluent chaining - Throws:
AssertionError
- if the actualMultiset
is nullAssertionError
- if the actualMultiset
contains the given value a number of times different to the given count
-
containsAtLeast
Verifies the actualMultiset
contains the given value at least the given number of times.Example :
Multiset<String> actual = HashMultiset.create(); actual.add("shoes", 2); // assertions succeed assertThat(actual).containsAtLeast(1, "shoes"); assertThat(actual).containsAtLeast(2, "shoes"); // assertion fails assertThat(actual).containsAtLeast(3, "shoes");
- Parameters:
minimumCount
- the minimum number of times the given value should appear in the setexpected
- the value which to expect- Returns:
- this
MultisetAssert
for fluent chaining - Throws:
AssertionError
- if the actualMultiset
is nullAssertionError
- if the actualMultiset
contains the given value fewer times than the given count
-
containsAtMost
Verifies the actualMultiset
contains the given value at most the given number of times.Example :
Multiset<String> actual = HashMultiset.create(); actual.add("shoes", 2); // assertions succeed assertThat(actual).containsAtMost(3, "shoes"); assertThat(actual).containsAtMost(2, "shoes"); // assertion fails assertThat(actual).containsAtMost(1, "shoes");
- Parameters:
maximumCount
- the maximum number of times the given value should appear in the setexpected
- the value which to expect- Returns:
- this
MultisetAssert
for fluent chaining - Throws:
AssertionError
- if the actualMultiset
is nullAssertionError
- if the actualMultiset
contains the given value more times than the given count
-
toAssert
- Specified by:
toAssert
in classAbstractIterableAssert<MultisetAssert<T>,
Multiset<? extends T>, T, ObjectAssert<T>>
-
newAbstractIterableAssert
- Specified by:
newAbstractIterableAssert
in classAbstractIterableAssert<MultisetAssert<T>,
Multiset<? extends T>, T, ObjectAssert<T>>
-