Abstract
One of the major goals, whether it’s on the iOS platform or not, is to isolate the code that we’re testing. When we write our tests, we want to test a specific class’s method without any of the associated interactions with other classes in the app or any external elements, such as a web service. We should be testing a single method, not its dependencies. This method should also be the only code covered by the test, with everything else mocked.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Godfrey Nolan
About this chapter
Cite this chapter
Nolan, G. (2017). Mocking. In: Agile Swift. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2102-0_4
Download citation
DOI: https://doi.org/10.1007/978-1-4842-2102-0_4
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-2101-3
Online ISBN: 978-1-4842-2102-0
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)