mercredi 2 septembre 2015

OpenCover.Console test fails when code reads data from config file

I have this strange problem. When I use the OpenCover from Visual Studio all tests pass and everything seems fine.

Image from Visual Studio here: http://ift.tt/1Jxvceb

But when I want to automate the tests using the OpenCover.Console.exe than some tests fail. I have noticed that the 2 failing tests read from config file.

Either the test or the code that is tested reads from config file using ConfigurationManager.AppSettings["someConfigValue"]. I have the same values in the main project and the test project appsettings.

The two failing tests when executing from console image here: http://ift.tt/1LTm4GP

In addition I provide the command used for OpenCover.Console.exe.

"OpenCover.Console.exe" -register -target:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" -targetargs:"/noisolation /testcontainer:\"E:\TEAM\TestProject.Tests\bin\Debug\TestProject.Tests.dll" /resultsfile:TestResults.trx" -mergebyhash -output:CodeCoverage.xml

Aucun commentaire:

Enregistrer un commentaire