1

I’m currently migrating my ASP.NET Core app from .NET Core 2.2 to Core 3.0 Preview 9. I'm struggling to get integration tests working with Entity Framework Core 3.0 Preview 9 InMemory DB provider in ASP.NET Core 3.0 Preview 9. I followed Microsoft's documentation "Integration tests in ASP.NET Core" which shows the approach of how to use a customize the WebApplicationFactory.

The problem what I'm facing is:

The integration test isn't using the InMemory DB provider from the customized the WebApplicationFactory.

I create a super simple web API that is using the Entity Framework Core and an SQLite database. This repo contains the same application base on ASP.NET Core 2.2 and EF Core 2.2 which works perfectly fine.

Here the link to the repo: https://github.com/stevo-knievo/IntegrationTestDotNetCore3.0

I tried for hours - Any suggestions are more than welcome.

Thanks in advance!

stevo
  • 2,164
  • 4
  • 23
  • 33
  • Preview (a,k.a. alpha, beta) versions are not supposed to be used in production. The best suggestion is to wait for 3.0 release (or at least release candidate) before migrating from stable 2.x. – Ivan Stoev Sep 11 '19 at 18:49
  • .NET Core Preview 9 is considered production ready by Microsoft and is fully supported. Starting with preview 7. Please see here: https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0 – stevo Sep 11 '19 at 19:08
  • Yes, but as you noticed, it's not really that ready. Also see the EF Core document about that preview - https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-3-0-preview-9-and-entity-framework-6-3-preview-9/. For instance *"In Preview 9 the functionality of the in-memory provider is still very limited, but this is already fixed in our daily builds. In fact, we have already fixed more than 20 issues that aren’t included in Preview 9, and we may still fix a few more before RTM."* which might be causing your issue. – Ivan Stoev Sep 11 '19 at 19:20
  • May be take their advice - **Consider installing daily builds** :) – Ivan Stoev Sep 11 '19 at 19:22
  • I appreciate your help @IvanStoev! I just tried the daily builds and pushed the branch to the repo. Same issues the integration test is using the application DB provider instead of the InMemory DB provider set up in the customized WebApplicationFactory class. – stevo Sep 11 '19 at 22:22
  • 1
    I opened an issue on GitHub: https://github.com/aspnet/AspNetCore/issues/13918 – stevo Sep 12 '19 at 01:17
  • @stevo Can you please provide a sample (other than that on the link mentioned on the Github issue that you opened ) ? I am still facing this issue !! – kuldeep Mar 16 '20 at 10:45

0 Answers0