假设我们有:
- (NSString *)someMethod:(NSString *)input
{
NSError *error = nil;
NSString *result = [otherObject processInput:input error:&error];
if (error == nil) {
return result;
}
else {
return nil;
}
}
如何使用 Kiwi 对其进行单元测试以检查其他行为?
当然我可以放一些讨厌的东西,input
但我不想使用这种方法。它是方法的单元测试someMethod:
,而不是processInput:error:
方法的单元测试,它otherObject
是一个KWMock
. 我一直在尝试使用KWCaptureSpy
类,或者stub: withArguments:
我用错了它们,或者它们不是解决方案。
问候