I would recommend rethinking your testing strategy.
But now I want to add a unit test for MyRequestsQueue that checks if queue executes only one operation at the time. Or even better - test that number of currently executing operations is not greater than maxConcurrentOperationCount.
Both of these tests would be testing Apple's implementation of NSOperationQueue
, which wouldn't gain you anything. You don't want to be unit testing code you don't own, and in general you should assume that Apple have correctly tested their own code. If NSOperationQueue
ran more concurrent operations than it should, Apple would have a big problem!
Instead, I would simply test that after it's been initialized, your MyRequestsQueue
has set the correct maxConcurrentOperationCount
on its NSOperationQueue
.