I have a problem with running automated tests on my Jenkins build server since I moved the connection strings from my config files to searate files using <connectionStrings configSource="connectionStrings.config"/>
When I open the project from the Jenkins workspace in VS2013 and run the tests, everything works fine. When I try running the tests as part of the build job with the command
"C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe" Path\To\Project\ProjectName.Tests.csproj /xml=TestResults.xml
I get errors in the console saying:
Test Error : ProjectName.Tests.TestClass.TestIfSomethingWorks
System.InvalidOperationException : No connection string named 'ConnectionStringName' could be found in the application config file.
Of course, both the app.config
file and the connectionStrings.config
file are in the root folder of the test project AND the projects in the solution that use these connection strings.
Am I doing something wrong? How to fix this?