You can watch this episode by subscribing to Cocoacasts Plus.

Mastering MVVM With Swift

Protocol Oriented Programming and Dependency Injection (Combine)

If we want to unit test the AddLocationViewModel class, we need the ability to stub the responses of the geocoding requests we make to Apple's location services. Only then can we write fast and reliable unit tests. Being in control of your environment is essential if your goal is creating a fast and robust test suite.

Instant and Unlimited Access
to 500+ Cocoacasts Tutorials

Monthly

$19 / month

Pay Once a Month
30 Day Money Back Guarantee

Yearly

$8.25 / month (billed annually)

Pay Once a Year and Save $129
30 Day Money Back Guarantee