0
votes

I am using xcode and my mocking frameworks is OCMock. How can i use OCMock to mock that accessibility is turned on so i can run some simple accessibility UI tests ?

Should i mock UIAccessibilityIsVoiceOverRunning() if so how would i do that ?

i tried the following but it wont compile:

__block id mockClass = OCMClassMock (UIAccessibility.class);

it gives an error "use of undeclared identifer UIAccessibility". and that makes sense because its not a class. My end goal is to mock UIAccessibilityIsVoiceOverRunning() method , thats it. but it looks like its a C function and cant be mocked/overrided

1

1 Answers

1
votes

As you mentioned already, UIAccessibilityIsVoiceOverRunning() is a function and not a method of a class. OCMock cannot mock functions.