Structure
OrderedVerificationOptions
public struct OrderedVerificationOptions: OptionSet
Additional options to increase the strictness of inOrder
verification blocks.
Relationships
Conforms To
OptionSet
Initializers
init(rawValue:)
public init(rawValue: Int)
Properties
rawValue
public let rawValue: Int
noInvocationsBefore
public static let noInvocationsBefore
Check that there are no recorded invocations before those explicitly verified in the block.
Use this option to disallow invocations prior to those satisfying the first verification.
bird.eat()
bird.fly()
bird.chirp()
// Passes _without_ the option
inOrder {
verify(bird.fly()).wasCalled()
verify(bird.chirp()).wasCalled()
}
// Fails with the option
inOrder(with: .noInvocationsBefore) {
verify(bird.fly()).wasCalled()
verify(bird.chirp()).wasCalled()
}
noInvocationsAfter
public static let noInvocationsAfter
Check that there are no recorded invocations after those explicitly verified in the block.
Use this option to disallow subsequent invocations to those satisfying the last verification.
bird.fly()
bird.chirp()
bird.eat()
// Passes _without_ the option
inOrder {
verify(bird.fly()).wasCalled()
verify(bird.chirp()).wasCalled()
}
// Fails with the option
inOrder(with: .noInvocationsAfter) {
verify(bird.fly()).wasCalled()
verify(bird.chirp()).wasCalled()
}
onlyConsecutiveInvocations
public static let onlyConsecutiveInvocations
Check that there are no recorded invocations between those explicitly verified in the block.
Use this option to disallow non-consecutive invocations to each verification.
bird.fly()
bird.eat()
bird.chirp()
// Passes _without_ the option
inOrder {
verify(bird.fly()).wasCalled()
verify(bird.chirp()).wasCalled()
}
// Fails with the option
inOrder(with: .noInvocationsAfter) {
verify(bird.fly()).wasCalled()
verify(bird.chirp()).wasCalled()
}