Skip to content

Commit a648f17

Browse files
committed
Update OsSettingsResolverTest.cs
1 parent 583c676 commit a648f17

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/DiffEngine.Tests/OsSettingsResolverTest.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Assembly = System.Reflection.Assembly;
22

3+
[NotInParallel]
34
public class OsSettingsResolverTest
45
{
56
[Test]
@@ -32,7 +33,7 @@ public async Task TryFindForEnvironmentVariable_WithEnvFile()
3233
Environment.SetEnvironmentVariable("DiffEngine_FakeTool", location);
3334
try
3435
{
35-
await Assert.That(OsSettingsResolver.TryFindForEnvironmentVariable("FakeTool", "DiffEngine.Tests.dll", out var envPath)).IsTrue();
36+
await Assert.That(OsSettingsResolver.TryFindForEnvironmentVariable("FakeTool", Path.GetFileName(location), out var envPath)).IsTrue();
3637
await Assert.That(envPath).IsEqualTo(location);
3738
}
3839
finally
@@ -48,7 +49,7 @@ public async Task TryFindForEnvironmentVariable_WithEnvFile_incorrectCase()
4849
Environment.SetEnvironmentVariable("DiffEngine_FakeTool", location);
4950
try
5051
{
51-
await Assert.That(OsSettingsResolver.TryFindForEnvironmentVariable("FakeTool", "diffengine.tests.dll", out var envPath)).IsTrue();
52+
await Assert.That(OsSettingsResolver.TryFindForEnvironmentVariable("FakeTool", Path.GetFileName(location).ToLowerInvariant(), out var envPath)).IsTrue();
5253
await Assert.That(envPath).IsEqualTo(location);
5354
}
5455
finally
@@ -64,7 +65,7 @@ public async Task TryFindForEnvironmentVariable_WithEnvDir()
6465
Environment.SetEnvironmentVariable("DiffEngine_FakeTool", Path.GetDirectoryName(location));
6566
try
6667
{
67-
await Assert.That(OsSettingsResolver.TryFindForEnvironmentVariable("FakeTool", "DiffEngine.Tests.dll", out var envPath)).IsTrue();
68+
await Assert.That(OsSettingsResolver.TryFindForEnvironmentVariable("FakeTool", Path.GetFileName(location), out var envPath)).IsTrue();
6869
await Assert.That(envPath).IsEqualTo(location);
6970
}
7071
finally
@@ -96,7 +97,7 @@ public async Task EnvPath()
9697
{
9798
var found = OsSettingsResolver.TryFindInEnvPath("cmd.exe", out var filePath);
9899
await Assert.That(found).IsTrue();
99-
await Assert.That(filePath).IsEqualTo(@"C:\Windows\System32\cmd.exe");
100+
await Assert.That(filePath!.ToLowerInvariant()).IsEqualTo(@"c:\windows\system32\cmd.exe");
100101
}
101102

102103
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
@@ -126,6 +127,6 @@ public async Task EnvVar()
126127
out var filePath,
127128
out _);
128129
await Assert.That(found).IsTrue();
129-
await Assert.That(filePath).IsEqualTo(@"C:\Windows\System32\cmd.exe");
130+
await Assert.That(filePath!.ToLowerInvariant()).IsEqualTo(@"c:\windows\system32\cmd.exe");
130131
}
131132
}

0 commit comments

Comments
 (0)