Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Load runsettings
hvkooten
#1 Posted : Thursday, December 19, 2024 10:05:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/30/2023(UTC)
Posts: 3
Location: Netherlands

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?
Remco
#2 Posted : Thursday, December 19, 2024 10:58:58 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,163

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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?
hvkooten
#3 Posted : Friday, December 20, 2024 10:22:09 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/30/2023(UTC)
Posts: 3
Location: Netherlands

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
Remco
#4 Posted : Friday, December 20, 2024 10:59:04 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,163

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
hvkooten;17812 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.
hvkooten
#5 Posted : Friday, December 20, 2024 12:08:38 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/30/2023(UTC)
Posts: 3
Location: Netherlands

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.
Remco
#6 Posted : Friday, December 20, 2024 12:31:53 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,163

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
hvkooten;17814 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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download