An example of how to use EF Core to unit test logic that might behave differently when DB is involved. It includes EF Core In-Memory DB and in-memory SQLite providers. The example is built on top of Jason Taylor's Northwind project for sake of simplicity.
Clone or download
Pull request Compare This branch is 4 commits ahead, 73 commits behind JasonGT:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
Application.Tests
Application
Common
Domain
Persistance
Presentation
.gitattributes
.gitignore
LICENSE.md
NorthwindTraders.sln
README.md

README.md

EF Core unit testing

This repository is a fork from Jason Taylor's Northwind and modified for demonstrating EF Core unit testing for user group presentations.

You can find the original blog post regarding this topic on my blog. https://jkdev.me/ef-core-unit-tests/

Original Readme:

NorthwindTraders

Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.

The initial purpose of this solution is to create a code first version of Northwind, using the .NET Core stack.

The construction of this project is explained in the following blog posts:

Getting Started

Use these instuctions to get the project up and running.

Prerequisites

You will need the following tools:

Setup

Follow these steps to get your development environment setup:

  1. Clone the repository
  2. At the root directory, restore required packages by running:
    dotnet restore
    
  3. Next, build the solution by running:
    dotnet build
    
  4. Finally, within the NorthwindTraders directory, launch the project by running:
    dotnet run
    

Technologies

  • .NET Core 2.1 RC
  • ASP.NET Core 2.1 RC
  • Entity Framework Core 2.1 RC

License

This project is licensed under the MIT License - see the LICENSE.md file for details.