Create LocalDB for testing from Visual Studio SQL project
I'm trying to create an integration tests for my project. I need to test a controller that makes call to stored procedure through repository. An empty database should be created on each runs of certain scope of tests. So I'm going to implement the following steps: Create LocalDB Run some Pre-scripts(to add test data) Run test Run some Post-scripts (if needed to run other test on this database) Remove LocalDB In my solution I have .sqlproj with all tables and SPs. How can I create LocalDB with the same structure as in .sqlproj from C# code? Or how can I generate the script with all objects to