Objective-C 的模拟对象
立即下载
资源介绍:
使用 OCMock – 简短版本
为实例和类方法创建存根
模拟对象代表真实对象。使用存根,我们可以指定调用方法时要返回的内容:
// create a mock for the user defaults
id userDefaultsMock = OCMClassMock([NSUserDefaults class]);
// set it up to return a specific value when stringForKey: is called
OCMStub([userDefaultsMock stringForKey:@"MyAppURLKey"]).andReturn(@"http://testurl");
// set it up to return the specified value no matter how the method is invoked
OCMStub([userDefaultsMock stringForKey:[OCMArg any]]).andReturn(@"http://testurl");
OCMock
======
![Build Status](https://github.com/erikdoe/ocmock/actions/workflows/build-and-test.yaml/badge.svg?branch=master)
OCMock is an Objective-C implementation of mock objects.
For downloads, documentation, and support please visit [ocmock.org](http://ocmock.org/).
资源文件列表:
ocmock-master.zip 大约有336个文件