May 2019
Intermediate to advanced
504 pages
11h 50m
English
Without further ado, let's take a look at the first view model in our application and implement some unit tests for it. The products view model is a simple view model that, on initialization, loads the products data using the available service client. It exposes two properties, namely, the Items collection and the ItemTapped command. Using this information, we can identify the units.
The units of the application, can be identified by implementing simple stubs as shown in the following code:
public class ListItemViewModel : BaseBindableObject { public ListItemViewModel(IApiClient apiClient, INavigationService navigationService) { //...Load products and initialize ItemTapped command } public ObservableCollection ...Read now
Unlock full access