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
I faced into next problem.
I'm replacing dbContext to InMemory by myself in TechStartup.cs in method ConfigureTestServices.
Then in my startup class, I have a method which seeding some data into db.
But later on, when I execute the controller method by Db replaced by MyTested.AspNetCore.EntityFrameworkCore to its in-memory DB context.
Can you advice how to avoid it?
The text was updated successfully, but these errors were encountered:
@grinay Why do you replace the DbContext by yourself? What do you want to accomplish? Do you just want to seed global data for every test case? Is that the scenario here?
@ivaylokenov yes, basically in the startup class on the first run seeding some data into the database, eventually this data isn't available in dB for a test. Also in some scenarios, we are testing against the real SQL database, to test constraints, etc. And if I want to use data extension to check data in DB, i need to install mytested entity framework extension, which replaces DbContext to in-memory, and I am unable to find an option to disable this.
I faced into next problem.
I'm replacing dbContext to InMemory by myself in TechStartup.cs in method ConfigureTestServices.
Then in my startup class, I have a method which seeding some data into db.
But later on, when I execute the controller method by Db replaced by MyTested.AspNetCore.EntityFrameworkCore to its in-memory DB context.
Can you advice how to avoid it?
The text was updated successfully, but these errors were encountered: