Codit / practical-api-guidelines

Practical guidelines for building & designing APIs with .NET.
MIT License
16 stars 5 forks source link

Fix integration-tests in maturity level 1 #124

Closed fgheysels closed 5 years ago

fgheysels commented 5 years ago

When running the build in release mode, the integration-tests in maturity level 1 where failing because the tests spinned up a WebHost that has no configuration. Due to that, the connectionstring to the database (which was used in release build modes) could not be found.
The simplest way to fix this, was to try to retrieve the connectionstring to the DB. If no connectionstring could be found, an InMemory DB is used, otherwise a connection to the specified DB is made. There is no distinction anymore between release & debug builds.

To me, this is not ideal though. It would be better if we could have a setting that explicitly states what kind of DB that must be used, but I think this will do for now.

tomkerkhove commented 5 years ago

/azp run ci

azure-pipelines[bot] commented 5 years ago

Azure Pipelines successfully started running 1 pipeline(s).