Classes
- ArgumentCaptor
-
Captures method arguments passed during mock invocations.
- ArgumentMatcher
-
Matches argument values with a comparator.
- NonEscapingClosure
-
Placeholder for non-escaping closure parameter types.
- Context
-
Container for mock state and metadata.
- AnyDeclaration
-
Mockable declarations.
- VariableDeclaration
-
Mockable variable declarations.
- PropertyGetterDeclaration
-
Mockable property getter declarations.
- PropertySetterDeclaration
-
Mockable property setter declarations.
- FunctionDeclaration
-
Mockable function declarations.
- ThrowingFunctionDeclaration
-
Mockable throwing function declarations.
- SubscriptDeclaration
-
Mockable subscript declarations.
- SubscriptGetterDeclaration
-
Mockable subscript getter declarations.
- SubscriptSetterDeclaration
-
Mockable subscript setter declarations.
- StaticMock
-
Used to store invocations on static or class scoped methods.
- MockingContext
-
Stores invocations received by mocks.
- DynamicStubbingManager
-
An intermediate object used for stubbing Objective-C declarations returned by
given
. - InvocationRecorder
-
Records invocations for stubbing and verification.
- ProxyContext
-
Stores potential targets that can handle forwarded invocations from mocked calls.
- StaticStubbingManager
-
An intermediate object used for stubbing Swift declarations returned by
given
. - StubbingManager
-
An intermediate object used for stubbing declarations returned by
given
. - ErrorBox
-
Used to forward errors thrown from stubbed implementations to the Objective-C runtime.
- SwiftErrorBox
-
Holds Swift errors which are bridged to
NSErrors
. - ObjCErrorBox
-
Holds Objective-C
NSError
objects. - StubbingContext
-
Stores stubbed implementations used by mocks.
- ObjCInvocation
-
An invocation recieved by an Objective-C.
- VerificationManager
-
An intermediate object used for verifying declarations returned by
verify
.
Structures
- CountMatcher
-
Checks whether a number matches some expected count.
- Mockable
-
Represents a mocked declaration that can be stubbed or verified.
- MockMetadata
-
Stores information about generated mocks.
- ImplementationProvider
-
Provides implementation functions used to stub behavior and return values.
- ForwardingContext
-
Intermediary object for binding forwarding targets to a mock.
- ValueProvider
-
Provides concrete instances of types.
- SourceLocation
-
References a line of code in a file.
- OrderedVerificationOptions
-
Additional options to increase the strictness of
inOrder
verification blocks.
Enumerations
- InvocationRecorder.Mode
-
Used to attribute declarations to stubbing and verification calls in tests.
- StubbingManager.TransitionStrategy
-
When to use the next chained implementation provider.
- SelectorType
-
Attributes selectors to a specific member type.
Protocols
- Declaration
-
All mockable declaration types conform to this protocol.
- Mock
-
All generated mocks conform to this protocol.
- Providable
-
A type that can provide concrete instances of itself.
- TestFailer
-
A type that can handle test failures emitted by Mockingbird.
Functions
- arg(_:at:)
-
Specifies the argument position for an argument matcher.
- firstArg(_:)
-
Specifies the first argument position for an argument matcher.
- secondArg(_:)
-
Specifies the second argument position for an argument matcher.
- thirdArg(_:)
-
Specifies the third argument position for an argument matcher.
- fourthArg(_:)
-
Specifies the fourth argument position for an argument matcher.
- fifthArg(_:)
-
Specifies the fifth argument position for an argument matcher.
- any(_:containing:)
-
Matches any collection containing all of the values.
- any(_:containing:)
-
Matches any dictionary containing all of the values.
- any(_:keys:)
-
Matches any dictionary containing all of the keys.
- any(_:count:)
-
Matches any collection with a specific number of elements.
- notEmpty(_:)
-
Matches any collection with at least one element.
- around(_:tolerance:)
-
Matches floating point arguments within some tolerance.
- exactly(_:)
-
Matches an exact count.
- atLeast(_:)
-
Matches greater than or equal to some count.
- atMost(_:)
-
Matches less than or equal to some count.
- between(_:)
-
Matches counts that fall within some range.
- not(_:)
-
Negate a count matcher, only passing on non-matching counts.
- not(_:)
-
Negate an exact count, only passing on non-matching counts.
- any(_:)
-
Matches all argument values.
- any(_:)
-
Matches all Objective-C object argument values.
- any(_:of:)
-
Matches argument values equal to any of the provided values.
- any(_:of:)
-
Matches argument values identical to any of the provided values.
- any(_:where:)
-
Matches any argument values where the predicate returns
true
. - any(_:where:)
-
Matches any Objective-C object argument values where the predicate returns
true
. - notNil(_:)
-
Matches any non-nil argument value.
- notNil(_:)
-
Matches any non-nil Objective-C object argument value.
- mock(_:)
-
Returns a mock of a given Swift type.
- mock(_:)
-
Returns a dynamic mock of a given Objective-C object type.
- reset(_:)
-
Remove all recorded invocations and configured stubs.
- reset(_:)
-
Remove all recorded invocations and configured stubs.
- clearInvocations(on:)
-
Remove all recorded invocations.
- clearInvocations(on:)
-
Remove all recorded invocations.
- clearStubs(on:)
-
Remove all concrete stubs.
- clearStubs(on:)
-
Remove all concrete stubs.
- clearDefaultValues(on:)
-
Remove all registered default values.
- forwardToSuper()
-
Forward calls for a specific declaration to the superclass.
- forward(to:)
-
Forward calls for a specific declaration to an object.
- lastSetValue(initial:)
-
Stubs a variable getter to return the last value received by the setter.
- sequence(of:)
-
Stub a sequence of values.
- sequence(of:)
-
Stub a sequence of implementations.
- loopingSequence(of:)
-
Stub a looping sequence of values.
- loopingSequence(of:)
-
Stub a looping sequence of implementations.
- finiteSequence(of:)
-
Stub a finite sequence of values.
- finiteSequence(of:)
-
Stub a finite sequence of implementations.
- given(_:)
-
Stub a declaration to return a value or perform an operation.
- given(_:)
-
Stub a declaration to return a value or perform an operation.
- eventually(_:_:)
-
Create a deferrable test expectation from a block containing verification calls.
- inOrder(with:file:line:_:)
-
Enforce the relative order of invocations.
- verify(_:file:line:)
-
Verify that a mock recieved a specific invocation some number of times.
- verify(_:file:line:)
-
Verify that a mock recieved a specific invocation some number of times.
- swizzleTestFailer(_:)
-
Change the current global test failer.
Variables
- never
-
A count of zero.
- once
-
A count of one.
- twice
-
A count of two.
Operators
- ~>
-
The stubbing operator is used to bind an implementation to an intermediary
Stub
object.
Extensions
- Array
- Dictionary
- NSObjectProtocol
- Optional
- Set