I have a Utility class with some class methods.
@interface DataValidator : NSObject
+ (BOOL)foo;
@end
The usage of the class is inside other classes, say NetworkManager, DBHandler etc. And since there are no instance methods in Utility class, there is no need for any class to create an instance of Utility class. Rather they directly make the calls like this
[Utility foo];
When writing tests for NetworkManager/DBHandler, is it possible to mock Utility and stub foo so all calls made to it return the mocked response.
If I mock the Utility class in NetworkManager class tests, the NetworkManager code still calls original method instead of the stubbed one.
This only works if I directly call [Utility foo] from inside the tests, but thats not useful in my case.