You can watch this episode by subscribing to Cocoacasts Plus.

Building a Weather Application From Scratch

Writing Unit Tests for the Day View Model

Download Your Free Copy of
The Missing Manual
for Swift Development

The Guide I Wish I Had When I Started Out

Join 20,000+ Developers Learning About Swift Development

Download Your Free Copy

Because a view model isn't or shouldn't be coupled to the user interface, it's easy to write unit tests for a view model. I'd like to illustrate that in this episode by writing a handful of unit tests for the DayViewModel struct. If you're new to unit testing, then this episode is an excellent start.

Instant and Unlimited Access
to 400+ Cocoacasts Tutorials


$19 / month

Pay Once a Month
30 Day Money Back Guarantee


$8.25 / month (billed annually)

Pay Once a Year and Save $129
30 Day Money Back Guarantee
Access to All Books

Next Episode "Implementing the Week View Model"