From your screenshot, for the memory solution, you're attempting to open a single connection (Singleton service, connection Open) for an arbitrary number? or single that you use in parallel? db context.
When using dependency injection, you should set it up with a factory, and then inject the factory and create db connections from that, which will use and open a specified connection.
For unit tests you will want to ensure each test run instantiates its own database, in a defined state. Then they can run in parallel.
To improve efficiency, it may be possible to set up one DB for read-only tests, or separate tables or schema for test cases. Which may or may not make sense depending on what you want to test. Separation is better to start with.