Few months ago I wrote a post about how to use the new InMemoryDbContext of Entity Framework Core in our unit tests and substitute the real context with an in-memory implementation, avoiding to connect to the real database. Now that Entity Framework Core 2.0 has been released, I upgraded my project and I found a... Continue Reading →
Unit Testing in .NET Core with xUnit
In this post we see how to do unit testing in .NET Core with xUnit. xUnit is a popular framework, with a lot of features and helpers to develop quickly our unit testings and implement them with a clean syntax; it's very efficient and the result is that the tests execution is very fast. In... Continue Reading →
In-memory DbContext with Entity Framework Core
Frequently, when we need to test a EF context from our unit test class, we need to implement a stub of the context manually, in order to have, for example, an in memory representation of the context. In entity framework core this is useless because one of the options available to initialize a context is... Continue Reading →