@@ -297,6 +297,7 @@ public void When_argument_type_is_more_specific_than_parameter_type_then_paramet
297
297
[ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( ExistingFile ) ) ]
298
298
[ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( ExistingDirectory ) ) ]
299
299
[ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( NonexistentPathWithTrailingSlash ) ) ]
300
+ [ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( NonexistentPathWithTrailingAltSlash ) ) ]
300
301
[ InlineData ( typeof ( FileSystemInfo ) , true , nameof ( NonexistentPathWithoutTrailingSlash ) ) ]
301
302
302
303
[ InlineData ( typeof ( string [ ] ) , false ) ]
@@ -545,7 +546,18 @@ public void Apply(InvocationContext context)
545
546
. Should ( )
546
547
. Be ( NonexistentPathWithTrailingSlash ( ) ) ,
547
548
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
+
549
561
BindingTestCase . Create < FileSystemInfo > (
550
562
NonexistentPathWithoutTrailingSlash ( ) ,
551
563
fsi => fsi . Should ( )
@@ -582,6 +594,8 @@ private static string NonexistentPathWithoutTrailingSlash()
582
594
583
595
private static string NonexistentPathWithTrailingSlash ( ) =>
584
596
NonexistentPathWithoutTrailingSlash ( ) + Path . DirectorySeparatorChar ;
597
+ private static string NonexistentPathWithTrailingAltSlash ( ) =>
598
+ NonexistentPathWithoutTrailingSlash ( ) + Path . AltDirectorySeparatorChar ;
585
599
586
600
private static string ExistingFile ( ) =>
587
601
Directory . GetFiles ( ExistingDirectory ( ) ) . FirstOrDefault ( ) ??
0 commit comments