mercredi 29 juillet 2015

OCMock - how to mock accessibility in iOS

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.

Aucun commentaire:

Enregistrer un commentaire