I'm writing this unit test:
- (void)testCellValues
{
id bookMock = [OCMockObject mockForClass:[LBBook class]];
[[[bookMock stub] andReturn:@"Book Title"] title];
}
Of course there is some code after that. But at this point I'm having this error when I execute the test:
[LBReviewsDashboardDataSourceTest testCellValues] failed: OCMockObject[LBBook]: cannot stub or expect method 'title' because no such method exists in the mocked class.
But LBBook
class has the attribute title
. This is the LBBook Class:
@interface LBBook : LBManagedObjectFactory
@property (nonatomic, retain) NSString * title;
@end
I cannot realise what is happening here, why Does OCMock return that error if the class has title attribute
?
Thanks in advance.