Class
VerificationManager
public class VerificationManager<InvocationType, ReturnType>
An intermediate object used for verifying declarations returned by verify
.
Methods
wasCalled(_:)
public func wasCalled(_ countMatcher: CountMatcher)
Verify that the mock received the invocation some number of times using a count matcher.
Parameters
Name | Type | Description |
---|---|---|
countMatcher | CountMatcher |
A count matcher defining the number of invocations to verify. |
wasCalled(_:)
public func wasCalled(_ times: Int = once)
Verify that the mock received the invocation an exact number of times.
Parameters
Name | Type | Description |
---|---|---|
times | Int |
The exact number of invocations expected. |
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
Name | Type | Description |
---|---|---|
type | ReturnType.Type |
The return type of the declaration to verify. |