I've written a custom conflict handling routine that automatically kicks in to resolve conflicting versions of NSFileVersion. Now I want to write unit tests for in order to make sure it works. Here is the question:
How do I cause/create conflicting versions within a unit test?
This essentiall boils down to: how do I cause a conflict without manually doing it through iCloud? Since this is for testing purposes only, I don't care abput using private API or hacking directly into the system -- as long as the result is a conflict reported from NSFileVersion's +unresolvedConflictVersionsOfItemAtURL
. Any advice would be highly appreciated!
Max
You could patch
+unresolvedConflictVersionsOfItemAtURL
with your own version that returns an array of conflicting versions:Is that enough to go on? I might first try this in my replacement "method":