We are implementing "Sync to Calendar" functionality within our application. Our synchronization process involves events that we obtain from server-side that we want to replicate to iPhone calendar. Currently I am not sure if the method that we wrote for this synchronization addresses all possible scenarios we expect to have this is why I want to unit test it. It contains numerous calls to EKEventStore which, as Apple documentation states, needs to be called with requestAccessToEntityType:completion:
first:
On iOS 6 and later, you must request access to an entity type after the event store is initialized with requestAccessToEntityType:completion: for data to return.
...which will be difficult to handle within environment in which our unit tests are run.
Currently I am thinking about implementing mock subclass of EKEventStore with some NSArray of EKEvent objects behind it.
Is there are any possibility to unit test against EKEventStore without writing such mock subclass which would mimic all the methods we use from inside our synchronization routine?