How you mock database when creating a unittest cases? #333
Unanswered
Naganathan
asked this question in
Q&A
Replies: 1 comment
-
Thanks to Testcontainers. You no longer need to mock a db for your unit or integration tests. Lookup testcontainers and get cracking. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
are you using same database (whatever used in source) for unit test case also?
Because it thrown exception, user don't have permission to access for that table.
How are you getting connectionstring from environment variable to mock database in unittest case?
https://github.com/kgrzybek/modular-monolith-with-ddd/blob/master/src/Tests/IntegrationTests/SeedWork/TestBase.cs#L44
Can we use In-Memory sql server database to mock?
Beta Was this translation helpful? Give feedback.
All reactions