Testing delegates and protocols in XCTest

The delegate pattern uses composition to provide similar advantages to object inheritance and is a pattern commonly used when developing for Apple's platforms. In this short post, Sarun Wongpatcharapakorn demonstrates his technique for testing code which uses delegation.