Maintaining application integrity with tests
The focus of this section will be on the unit testing and strategies and tools available for unit testing Xamarin applications. We will look at unit testing fundamentals, as well as mock and fixture concepts.
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 best choice for any agile development team. In this paradigm, developers are responsible, even before the first line of actual business logic implementation has been written, for creating unit tests that are appropriate for the current unit that is under development.
Arrange, Act, and Assert
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, upon initialization, loads the products data...