Resharper 2019 dotcover missing Path Environment Variable passing unittests and failing code coverage
Answered
Setup a Nunit test.
paste following code, run test as a unittest
[Test]
public void TestResharperCoverage()
{
string PathValue = "";
foreach (System.Collections.DictionaryEntry env in Environment.GetEnvironmentVariables())
{
string name = (string)env.Key;
string value = (string)env.Value;
if (name == "Path")
{
PathValue = value;
}
TestContext.WriteLine("{0}={1}", name, value);
Console.WriteLine("{0}={1}", name, value);
}
Assert.IsFalse(string.IsNullOrWhiteSpace(PathValue));
}
Run it as a unit test, it passes.
run coverage it fails due to no Environment Variable for Path.
We have a dependency in once of our unmanaged code nuget packages on Path.
Please sign in to leave a comment.
Hi!
This problem https://youtrack.jetbrains.com/issue/DCVR-9728 is already fixed, please update to the recent update ReSharper 2019.1.2.
Awesome, just noticed the update from 2 days ago. I'm installing it now.
Thanks for taking care of this so quickly. Love the tool.