Mockingbird Documentation 0.14.0

Function not(_:​)

public func not(_ countMatcher: CountMatcher) -> CountMatcher

Negate a count matcher, only passing on non-matching counts.

Combined count matchers can be used to perform complex checks on the number of invocations received.

// Checks that n ≠ 1
verify(bird.fly()).wasCalled(not(exactly(once)))

Parameters

count​Matcher Count​Matcher

A count matcher to negate.

Returns

A negated count matcher.