Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration testing data access in ASP.​NET Core #176

Open
utterances-bot opened this issue Mar 1, 2024 · 2 comments
Open

Integration testing data access in ASP.​NET Core #176

utterances-bot opened this issue Mar 1, 2024 · 2 comments

Comments

@utterances-bot
Copy link

Integration testing data access in ASP.​NET Core

https://asp.net-hacker.rocks/2019/01/18/integration-testing-data-access-dotnetcore.html

Copy link

massimilianokraus-kappas commented Mar 1, 2024

Actually .NET authors discourage mocking DbContexts and DbSets:

link

"Mocking DbSet for querying is complex and difficult, and suffers from the same disadvantages as the in-memory approach; we discourage this"

Copy link
Owner

True but pretty much depends on the context and what you actually like to test.
If you just need to fetch data I don't see any risk in mocking DbSets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants