Our team has a bunch of micro-apis, I'm currently setting up a C# specflow project to do unit testing on all our stored procedures. we have 3 options
Create a testing database for each micro-api. At the beginning of each test we clear the tables and populated them with test data, and run the stored procedure against it.
We won't create a test database, just wrap everything in a transaction. We still clear and populate test data and run stored procedure against it, but at the end of each test we rollback the transaction
Use an in-memory database, however, from my research I don't think SQL Server supports that. I looked into EF and SQL lite. (please correct me if I'm wrong)
What are the advantages and disadvantages of each. I'm trying to weigh them and see the best practice and what to watch out for.
I think option(1) is better because with option(2) other people might be using the database while your test cases are running and that could mess it up.
However with option(2) we won't have to create and maintain the testing database