Running db inmemory


.net 6 is amazing thing.

It allows you to take startup and spool it as a testrunner.

You even can take startup and replace specific parts of it to your desired.

For example you can replace dbcontextoptions with inmemory one that will runn all your tests in separate inmemry databases.

Except in oprimizely you can't - because it throws exception on starting host.

Is there any known way to force inmemory database?

Before someone will ask why use inmemory:

  • inmemory tests are order of magnitude faster
  • you have much better encapsulation of tests
  • no cleanup after
  • no need to have dedicated db just for pipelines
Nov 30, 2022 7:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.