2

I have a class that suppose to return a string when a method gets called. How can i create a mock object.

I want mock to return @"Hello" when the method "sayHello" get's called

id mock = [OCMockObject mockForClass:[MyCrazyClass class]];
razlebe
  • 7,134
  • 6
  • 42
  • 57
aryaxt
  • 76,198
  • 92
  • 293
  • 442

1 Answers1

5
[[[mock stub] andReturn:@"Hello"] yourMethod:someArgument];
kubi
  • 48,104
  • 19
  • 94
  • 118