In chapter 10 we’re introduced to the view model. The instructions suggest that we optimize the view model by writing a function such as:
extension PetViewModel { public func configure(_ view: PetView) { view.nameLabel.text = name view.imageView.image = image view.ageLabel.text = ageText view.adoptionFeeLabel.text = adoptionFeeText } }
How should we test this code? Should we instantiate a PetView in our unit tests and check its properties?