You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since EF Core 3.0 database queries that cannot be executed on the server run into an InvalidOperationException ("The LINQ expression xxx could not be translated"). That's fine. Unfortunately these exceptions are not thrown in my integration tests where I use an InMemory Database:
So although all my tests are green, I run into exceptions in production mode with my code.
How can I make my integration tests detect the invalid operation queries?
Steps to reproduce
Further technical details
EF Core version: 3.1.1
Database provider: Microsoft.EntityFrameworkCore.SqlServer and InMemory database
Target framework: netcoreapp3.1
Operating system: Windows 10
IDE: Microsoft Visual Studio Enterprise 2019 Version 16.4.4
The text was updated successfully, but these errors were encountered:
@JulidaRocks Fundamentally, you'll need to run your tests against the same database engine that your production code uses. This because there are differences in the sets of queries that can be translated against each type of database. See dotnet/EntityFramework.Docs#430 and dotnet/EntityFramework.Docs#1304, and also the discussion on #18457
Since EF Core 3.0 database queries that cannot be executed on the server run into an InvalidOperationException ("The LINQ expression xxx could not be translated"). That's fine. Unfortunately these exceptions are not thrown in my integration tests where I use an InMemory Database:
So although all my tests are green, I run into exceptions in production mode with my code.
How can I make my integration tests detect the invalid operation queries?
Steps to reproduce
Further technical details
EF Core version: 3.1.1
Database provider: Microsoft.EntityFrameworkCore.SqlServer and InMemory database
Target framework: netcoreapp3.1
Operating system: Windows 10
IDE: Microsoft Visual Studio Enterprise 2019 Version 16.4.4
The text was updated successfully, but these errors were encountered: