I have an Integration Test .NET 5 XUnit Project. I am using XUnit 2.4 and XUnit.Runner.VisualStudio 2.4. The Integration Tests in this project need one configuration value, the ApiUrl. I want to run the integration tests in two ways:
- From Visual Studio using All Test Run or ReSharper
- From Azure DevOps's Pipeline and pass the ApiUrl from the pipeline variables which will override the one from the project's settings
My questions:
- How do I do my configuration in a way that my test code accesses the ApiUrl in a transparent way (it doesn't care where it is running from)?
- How do I pass the variable ApiUrl to my Integration test project, I am using the
DotNetCoreCLI@2
test task as my pipeline step.