Implementing the WebApis with TDD
To build the WebApi project, we are going to look at each requirement from Chapter 8, Designing an Appointment Booking App, and provide the implementation that satisfies it using TDD style.
The requirements are all stated in terms of the Website and its functionality, and they do not dictate how to build our APIs. The Website will have to call the WebApis for any business logic as it has no access to the DB and deals with UI-related business logic only.
This chapter is dedicated to EF for a good reason as we want you to appreciate fakes, which are not as popular as mocks, both from the test doubles family. Also, it will be a typical example of a .NET solution of an ASP.NET Core and a relational DB implementation.
In this section, we will cover working in TDD mode, taking into consideration our persistence provider, EF.
Using the EF in-memory provider
To make our life easier when unit testing the system, we want to abstract the database...