Skip to content

Commit e9cb8f7

Browse files
committed
Fix InputFile filename assertion for OS differences
Update InputFileTests to account for platform-specific filename handling by checking the OS and adjusting the expected filename accordingly.
1 parent 9725af6 commit e9cb8f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/dotnet/Package.Tests/Models/InputFileTests.cs.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Runtime.InteropServices;
34
using Xunit;
45
using {{ spec.title | caseUcfirst }}.Models;
56

@@ -47,7 +48,8 @@ namespace {{ spec.title | caseUcfirst }}.Tests.Models
4748
var inputFile = InputFile.FromPath(path);
4849

4950
// Assert
50-
Assert.Equal("document.pdf", inputFile.Filename);
51+
string expectedFilename = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "document.pdf" : path;
52+
Assert.Equal(expectedFilename, inputFile.Filename);
5153
}
5254

5355
[Fact]

0 commit comments

Comments
 (0)