Before the methods of the mock objects can be used in the test, they need to be set up. This setup is preferably done in the constructor of the test class after the mock object is created and before the object is injected into the class that requires the dependency.
First, the data to be returned by the method to be set up will have to be created; this is the dummy data to be used in the test:
List<Loan> loans = new List<Loan>{ new Loan{Amount = 120000, Rate = 12.5, ServiceYear = 5, HasDefaulted = false }, new Loan {Amount = 150000, Rate = 12.5, ServiceYear = 4, HasDefaulted = true }, new Loan { Amount = 200000, Rate = 12.5, ServiceYear = 5, HasDefaulted = false }};
At the point of setting up the ...