Simplified Unit Testing with the Entity Framework Core InMemory Provider | Jason Taylor [OLD]

preview_player
Показать описание

|| Subscribe for more content from SSW TV ||

|| Press like and leave a comment below to let us know how we're doing ||

Twitter ↴

Facebook ↴

--- Description ---

In this talk, SSW’s Jason Taylor will show you how using the EF Core InMemory Provider will simplify your unit testing approach.

He will discuss the typical approach versus the simplified approach, limitations, and other considerations. You will walk away ready to write simplified unit tests for systems that depend on EF Core.

Credits:

------------------------------------------------------------------------------

Created by SSW TV | Videos By Developers, For Developers.

Рекомендации по теме
Комментарии
Автор

+1111 For saying that DbContext is a Unit of Work, and DbSet is a repository, and no need to recreate another repository pattern upon them! Very good explanation, thank you!

MohammedNoureldin
Автор

Awesome presentation mate, I got a lot out of this

pbardenetc
Автор

Very interesting, especially using the internal serviceprovider in testing (see sourcecode at 10:25)

roodborstkalf
Автор

Great lecture, without using service provider (new ServiceCollection())

we can use something like below, with

var _server = new TestServer(new WebHostBuilder()
.UseEnvironment("Testing")
.UseStartup<Startup>());
context = as TodoDbContext;

and Startup.cs
public IHostingEnvironment _hostingEnvironment { get; }

public Startup(IHostingEnvironment hostingEnvironment){
_hostingEnvironment = hostingEnvironment
}

public void services){
...
if
{
=>
{

});
}else { // UseSqlServer or .... }

dishanx