Iterables which contain an element matching every value in
expected in any order, and may contain additional values.
[0, 1, 0, 2, 0] matches
containsAll([1, 2]) and
containsAll([2, 1]) but not
containsAll([1, 2, 3]).
Will only match values which implement
Each element in the value will only be considered a match for a single
expected even if it could satisfy more than one. For instance
containsAll([greaterThan(1), greaterThan(2)]) will not be satisfied by
. To check that all matchers are satisfied within an iterable and allow
the same element to satisfy multiple matchers use
Note that this is worst case O(n^2) runtime and memory usage so it should only be used on small iterables.
Matcher containsAll(Iterable expected) => _ContainsAll(expected);