Regardless of the development or runtime platform, unit tests are an integral part of the development pipeline. In fact, nowadays, Test-Driven Development (TDD) is the most prominent development methodology and is the choice of any agile development team. In this paradigm, developers are responsible, even before the first line of actual business logic implementation is written, for creating unit tests that are appropriate for the current unit that is under development.
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...