|
That depends on how you build your viewmodel and how your testing framework handles async behaviors - so I can't give you a specific answer.
But for an example, the CSLA .NET ViewModelBase class raises a PropertyChanged event when the Model property changes, and you can use that to know when the async load is complete. The UnitDriven test framework we use for the CSLA unit tests has a technique
designed to allow you to wait (with a lambda callback) for the async operation to complete, process the various Assert calls, and then tell UnitDriven that the test is actually finished.
Other testing frameworks probably handle that scenario differently, but they all have some technique for dealing with async operations. Similarly, your viewmodel types may be constructed differently - the key is to have some event or other callback scheme
that you can use to be notified when the async operation is complete.
|