Reputation: 1442
id protocolMock = OCMProtocolMock(@protocol(SomeProtocol));
Will create a mock object that can be used as if it were an instance of an object that implements SomeProtocol.
Does OCMock provide a way to create a mock object that implements several protocols?
Upvotes: 3
Views: 890
Reputation:
In your test file, you can create a new protocol that implements the multiple ones you need:
@protocol MyTestProtocol <MyProtocolA, MyProtocolB>
@end
and then mock it:
id protocolMock = OCMProtocolMock(@protocol(MyTestProtocol));
Upvotes: 6
Reputation: 3015
This is currently not supported in OCMock. If you think this is a feature that really should be added, please log an issue on Github (https://github.com/erikdoe/ocmock/issues).
Upvotes: 1