@@ -297,6 +297,7 @@ public void When_argument_type_is_more_specific_than_parameter_type_then_paramet
297297 [ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( ExistingFile ) ) ]
298298 [ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( ExistingDirectory ) ) ]
299299 [ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( NonexistentPathWithTrailingSlash ) ) ]
300+ [ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( NonexistentPathWithTrailingAltSlash ) ) ]
300301 [ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( NonexistentPathWithoutTrailingSlash ) ) ]
301302
302303 [ InlineData ( typeof ( string [ ] ) , false ) ]
@@ -545,7 +546,18 @@ public void Apply(InvocationContext context)
545546 . Should ( )
546547 . Be ( NonexistentPathWithTrailingSlash ( ) ) ,
547548 variationName : nameof ( NonexistentPathWithTrailingSlash ) ) ,
548-
549+
550+ BindingTestCase . Create < FileSystemInfo > (
551+ NonexistentPathWithTrailingAltSlash ( ) ,
552+ fsi => fsi . Should ( )
553+ . BeOfType < DirectoryInfo > ( )
554+ . Which
555+ . FullName
556+ . Should ( )
557+ . Be ( NonexistentPathWithTrailingSlash ( ) ,
558+ "DirectoryInfo replaces Path.AltDirectorySeparatorChar with Path.DirectorySeparatorChar on Windows" ) ,
559+ variationName : nameof ( NonexistentPathWithTrailingAltSlash ) ) ,
560+
549561 BindingTestCase . Create < FileSystemInfo > (
550562 NonexistentPathWithoutTrailingSlash ( ) ,
551563 fsi => fsi . Should ( )
@@ -582,6 +594,8 @@ private static string NonexistentPathWithoutTrailingSlash()
582594
583595 private static string NonexistentPathWithTrailingSlash ( ) =>
584596 NonexistentPathWithoutTrailingSlash ( ) + Path . DirectorySeparatorChar ;
597+ private static string NonexistentPathWithTrailingAltSlash ( ) =>
598+ NonexistentPathWithoutTrailingSlash ( ) + Path . AltDirectorySeparatorChar ;
585599
586600 private static string ExistingFile ( ) =>
587601 Directory . GetFiles ( ExistingDirectory ( ) ) . FirstOrDefault ( ) ??
0 commit comments