On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote:
On Fri, Mar 16, 2018 at 08:17:49PM +0000, aberba via Digitalmars-d-learn wrote:
[...]

The usual way I do this is to decouple the code from the real database backend by templatizing the database driver. Then in my unittest I can instantiate the template with a mock database driver that only implements the bare minimum to run the test.

[...]

Mocking a fake database can also be huge pain. Especially when something like transactions and prepared statements are involved.

Imagine testing your mock for introduced by future extension.

Reply via email to