XUnit

.NET Core - xUnit Tests with Repository Pattern and IUNitOfWork

After some hours of frustration and asking myself whether I should have used Unit of Work in the first place (there are already layers of abstraction in the standard .NET Core template project) I managed to get a functioning xUnit test method that mocks the repositories, populates them with data and verifies the model returned by a controller method. Setting Up a Unit Test Project Add a xUnit project to the solution, then add an assembly reference in that to the project being tested.