Chapter 24, Testing the ViewModel

Hi everybody,

Is there any chance somebody could share a testing for the view models? One of the main goals of MVVM is to have testable view models. But I haven’t been able to figure out how to test the view models without a view controller.

Thanks in advance,

hi

The VM represents any information that the the VC uses for a specific state. You need test any state for this VM.
Normally, you should init the viewmodel and test if any property is correct.

regards,

This topic was automatically closed after 166 days. New replies are no longer allowed.