Unit Testing EF Data With Core 2.0

I’ve discussed using the in-memory database object for Entity Framework in the blog post titled: Dot Net Core In Memory Unit Testing Using xUnit. That was for .Net Core 1.1.  Now I’m going to show a larger example of the in-memory database object for .Net Core 2.0.  There is only one minor difference in the … Read moreUnit Testing EF Data With Core 2.0

Unit Testing EF Data With Moq

Introduction I’ve discussed using the in-memory Entity Framework unit tests in a previous post (here).  In this post, I’m going to demonstrate a simple way to use Moq to unit test a method that uses Entity Framework Core. Setup For this sample, I used the POCOs, context and config files from this project (here).  You … Read moreUnit Testing EF Data With Moq

Dot Net Core In Memory Unit Testing Using xUnit

When I started using .Net Core and xUnit I found it difficult to find information on how to mock or fake the Entity Framework database code.  So I’m going to show a minimized code sample using xUnit, Entity Framework, In Memory Database with .Net Core.  I’m only going to setup two projects: DataSource and UnitTests. … Read moreDot Net Core In Memory Unit Testing Using xUnit