Unit testing
We will start by testing the business logic in the TripLog app. We will do this by creating a new unit test project in our solution that will be responsible for testing our ViewModels.
There are many options and libraries to create unit tests in .NET. By default, Xamarin Studio leverages the popular NUnit framework for performing unit tests.
In order to create a unit test project, perform the following steps:
Create a new solution folder named
Tests
. While this is not required, it helps keep any testing-related projects organized within the overall solution. To add a new solution folder in Xamarin Studio, simply right click on the solution, go to Add and click on Add Solution Folder, as seen in Figure 1:Next, create a new NUnit project in the new
Tests
solution folder and name itTripLog.Tests
.
By default, the new NUnit project will contain a file named Test.cs. You can safely delete this file, as we will create...