Build/Test Issues

Load runsettings

Started by hvkooten on 2,238 views

Looking though the documentation and the forum, I can't find how to get .runsettings loaded in my TestContext.
Can anyone tell me how this is done?
Hi, thanks for posting.

NCrunch's MSTest support is emulated rather than integrated, and the emulator does not support loading settings from .runsettings. Is there something you need from there?
As a contractor, at my current assignment, thay have integration tests setup next to unit tests. The environment settings are loaded as testcontext properties to switch between environments. I cannot change this process. Therefore I hope there is a way to inject and switch between those .runsettins files
hvkooten wrote:As a contractor, at my current assignment, thay have integration tests setup next to unit tests. The environment settings are loaded as testcontext properties to switch between environments. I cannot change this process. Therefore I hope there is a way to inject and switch between those .runsettins files


Sorry, we don't support MSTest runsettings files.

Would it perhaps be possible to use environment variables instead? It's possible to override these using NCrunch settings (including engine modes). You could adjust the code so that when it reads environment settings from testcontext, it refers to System.Environment.GetEnvironmentVariable instead if the textcontext does not contain the expected setting.
I'm the only one using NCrunch in the team (I don't know why), so I cannot change the code for this to work.
hvkooten wrote:I'm the only one using NCrunch in the team (I don't know why), so I cannot change the code for this to work.


Sorry, we don't support runsettings. I can't suggest any workaround that does not involve changing the test code in some way.

Post a reply

Log in to reply.