When we have to test methods that involves Entity Framework, a typical choice that we have to face is use integration tests, with an effective database, or unit tests. If we choice the first option, with a database like SQL LocalDB, we'll have performance problems because the cost of the database creation and the data... 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 →