2

I'm currently investigating how to best implement integration tests. We use C# to build Azure Functions and have unit-tests in-place (runs as part of the build in Azure DevOps).

Next step is to include integration tests for integrating with MS SQL Server (we use Dapper). I have done some research and concluded that using an in-memory database is not the way to go (different engine). Therefore I'm wondering if it is possible to create a Docker image with a SQL Server or instantiate LocalDB(https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2017-Server2016-Readme.md does not list SQL Server Express or LocalDB), run scripts against it (to setup the database to the desired state) and then run integration tests (using MSTest)?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Casper
  • 1,051
  • 1
  • 8
  • 21

1 Answers1

2

Okay so sqllocaldb.exe is installed on the VS2017 build agents. I ended up using (and improving) https://github.com/ritterim/automation-sql to wrap sqlocaldb.exe in C#.

Casper
  • 1,051
  • 1
  • 8
  • 21