File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
StoneAge.Data.FileSystem.Tests Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,15 @@ public void GivenText_ExpectStringReturned()
4242 actual . Should ( ) . Be ( expected ) ;
4343 }
4444
45- [ Test ]
46- public void GivenFullFilePath_ExpectFileNameExtracted ( )
45+ [ TestCase ( @"c:\tmp\test.txt" ) ]
46+ [ TestCase ( @"/var/tmp/test.txt" ) ]
47+ public void GivenFullFilePath_ExpectFileNameExtracted ( string path )
4748 {
4849 //---------------Arrange-------------------
4950 var input = "a message in a file" ;
5051
5152 var sut = new DocumentBuilder ( )
52- . Using_Name_From_Path ( @"c:\tmp\test.txt" )
53+ . Using_Name_From_Path ( path )
5354 . With_String ( input )
5455 . Create_Document ( ) ;
5556 //---------------Act----------------------
Original file line number Diff line number Diff line change @@ -19,7 +19,11 @@ public IDocumentBuilderData With_Name(string name)
1919
2020 public IDocumentBuilderData Using_Name_From_Path ( string path )
2121 {
22- _name = Path . GetFileName ( path ) ;
22+ // Normalize all path separators to the current OS style
23+ var normalized = path
24+ . Replace ( '\\ ' , Path . DirectorySeparatorChar )
25+ . Replace ( '/' , Path . DirectorySeparatorChar ) ;
26+ _name = Path . GetFileName ( normalized ) ;
2327 return this ;
2428 }
2529
Original file line number Diff line number Diff line change 1111 <PackageId >StoneAge.FileSystem</PackageId >
1212 <Product >StoneAge.FileSystem</Product >
1313 <Authors >T-rav</Authors >
14- <Version >1.4.3 </Version >
14+ <Version >1.4.4 </Version >
1515 <PackageReleaseNotes >Adde MoveWithOverwrite to overwrite an existing file when moving</PackageReleaseNotes >
16- <FileVersion >1.4.3 .0</FileVersion >
17- <AssemblyVersion >1.4.3 .0</AssemblyVersion >
16+ <FileVersion >1.4.4 .0</FileVersion >
17+ <AssemblyVersion >1.4.4 .0</AssemblyVersion >
1818 </PropertyGroup >
1919
2020</Project >
You can’t perform that action at this time.
0 commit comments