❔ Mocking with EntityFrameworkCore
Hm,
I'm creating unit tests for a class that has a
And you can't really mock that as you would everything else, because you cannot instantiate any DbSet collections as they don't have a non-private constructor.
Anybody who has mocked stuff with DbContexts on them? I'm not sure how to approach this.
I'm creating unit tests for a class that has a
private readonly MyDbContext dbContext; that causes a few problems.And you can't really mock that as you would everything else, because you cannot instantiate any DbSet collections as they don't have a non-private constructor.
Anybody who has mocked stuff with DbContexts on them? I'm not sure how to approach this.