Class
StubbingContext
@objc(MKBStubbingContext) public class StubbingContext: NSObject
Stores stubbed implementations used by mocks.
Relationships
Conforms To
NSObject
Properties
noImplementation
@objc public static let noImplementation
Used to indicate that no implementation exists for a given invocation.
Methods
evaluateReturnValue(for:)
@objc public func evaluateReturnValue(for invocation: ObjCInvocation) -> Any?
Apply arguments to a Swift implementation forwarded by the Objective-C runtime.
Invocations with more than 10 arguments will throw a missing stubbed implementation error.
Parameters
Name | Type | Description |
---|---|---|
invocation | ObjCInvocation |
An Objective-C invocation to handle. |
Returns
The value returned from evaluating the Swift implementation.
provideDefaultValue(for:)
@objc public func provideDefaultValue(for invocation: ObjCInvocation) -> Any?
Attempts to return a value using the default value provider.
Parameters
Name | Type | Description |
---|---|---|
invocation | ObjCInvocation |
An Objective-C invocation to handle. |
Returns
A value or nil
if the provider could not handle the Objective-C return type.
failTest(for:)
@objc public func failTest(for invocation: ObjCInvocation) -> Never