Improved platform agnostic for test

This commit is contained in:
Florian Rappl
2026-08-03 14:36:20 +02:00
parent 3a2c997e6a
commit 16cbc5f2a4

View File

@@ -27,16 +27,17 @@ public class ElectronIconTargetsTests
await WriteMinimalCsprojAsync(tempDir);
var (exitCode, output) = await RunDotnetMsBuildAsync(tempDir, "DumpElectronIconCopyItems");
var normalizedOutput = NormalizePathSeparators(output);
exitCode.Should().Be(0,
$"MSBuild target evaluation must succeed. Full output:\n{output}");
output.Should().Contain(
@".electron\MyApp.icon\manifest.json",
normalizedOutput.Should().Contain(
".electron/MyApp.icon/manifest.json",
$"the icon package root file must be mapped into .electron/MyApp.icon. Full output:\n{output}");
output.Should().Contain(
@".electron\MyApp.icon\layers\foreground.png",
normalizedOutput.Should().Contain(
".electron/MyApp.icon/layers/foreground.png",
$"nested files in .icon package must preserve structure in .electron output. Full output:\n{output}");
}
finally
@@ -93,7 +94,7 @@ public class ElectronIconTargetsTests
<Import Project="{{propsPathEscaped}}" />
<PropertyGroup Label="ElectronNetCommon">
<ElectronIcon>Assets\MyApp.icon</ElectronIcon>
<ElectronIcon>Assets/MyApp.icon</ElectronIcon>
</PropertyGroup>
<Import Project="{{targetsPathEscaped}}" />
@@ -124,4 +125,9 @@ public class ElectronIconTargetsTests
return (process.ExitCode, stdOut + stdErr);
}
private static string NormalizePathSeparators(string value)
{
return value.Replace('\\', '/');
}
}