Mockingbird Documentation 0.18.0

Class Verification​Manager

public class VerificationManager<InvocationType, ReturnType>  

An intermediate object used for verifying declarations returned by verify.

Methods

was​Called(_:​)

public func wasCalled(_ countMatcher: CountMatcher)  

Verify that the mock received the invocation some number of times using a count matcher.

Parameters

count​Matcher Count​Matcher

A count matcher defining the number of invocations to verify.

was​Called(_:​)

public func wasCalled(_ times: Int = once)  

Verify that the mock received the invocation an exact number of times.

Parameters

times Int

The exact number of invocations expected.

was​Never​Called()

public func wasNeverCalled()  

Verify that the mock never received the invocation.

returning(_:​)

public func returning(_ type: ReturnType.Type = ReturnType.self) -> Self  

Disambiguate methods overloaded by return type.

Declarations for methods overloaded by return type cannot type inference and should be disambiguated.

protocol Bird {
  func getMessage<T>() throws -> T    // Overloaded generically
  func getMessage() throws -> String  // Overloaded explicitly
  func getMessage() throws -> Data
}

verify(bird.send(any()))
  .returning(String.self)
  .wasCalled()

Parameters

type Return​Type.​Type

The return type of the declaration to verify.