Orientation of various profiles during testing

I have a launchsettings.json file in my ASP.Net Core project with several different profiles, two of which allow me to switch between using SQL Server and Sqlite.

 "Windows: Dev - Sql Server": { "commandName": "Project", "environmentVariables": { "StorageProvider": "MSSQLServer", "ASPNETCORE_ENVIRONMENT": "Development" } }, "Windows: Dev - Sqlite": { "commandName": "Project", "environmentVariables": { "StorageProvider": "Sqlite", "ASPNETCORE_ENVIRONMENT": "Development" } }, 

I would like to run my integration tests with both profiles so that I can make sure that the abstraction level of the warehouse data provider works correctly for both data stores. How do I get started with my integration tests, which are only NUnit tests, under a given profile? I read the existing answer, but it is not applicable to me. I do not want to hardcode my desired profile / environment in tests. They must be configured so that I can run tests during automatic builds.

thanks

+5
source share

All Articles