I am looking into unit-testing a Swift class which uses Alamofire network library. What I want to do is to stub the download function of the library's Manager class with some simple behaviours that does not use the filesystem so that I can isolate my test cases from the filesystem.
The main problem that I found is that the download function is written as an extension and therefore cannot be overridden. (See Notes in extension documentation)
This case should apply to any other cases that would like to stub third-party library's functions defined with extensions. Any suggestions are welcome.
Aucun commentaire:
Enregistrer un commentaire