@@ -36,8 +36,8 @@ public static IEnumerable<object[]> MockDirectoryInfo_Exists_Cases
3636 {
3737 get
3838 {
39- yield return new object [ ] { XFS . Path ( @"c:\temp\folder" ) , true } ;
40- yield return new object [ ] { XFS . Path ( @"c:\temp\folder\notExistant" ) , false } ;
39+ yield return new object [ ] { XFS . Path ( @"c:\temp\folder" ) , true } ;
40+ yield return new object [ ] { XFS . Path ( @"c:\temp\folder\notExistant" ) , false } ;
4141 }
4242 }
4343
@@ -152,8 +152,8 @@ public void MockDirectoryInfo_GetParent_ShouldReturnDirectoriesAndNamesWithSearc
152152 [ Test ]
153153 public void MockDirectoryInfo_EnumerateFiles_ShouldReturnAllFiles ( )
154154 {
155- // Arrange
156- var fileSystem = new MockFileSystem ( new Dictionary < string , MockFileData >
155+ // Arrange
156+ var fileSystem = new MockFileSystem ( new Dictionary < string , MockFileData >
157157 {
158158 //Files "above" in folder we're querying
159159 { XFS . Path ( @"c:\temp\a.txt" ) , "" } ,
@@ -166,11 +166,11 @@ public void MockDirectoryInfo_EnumerateFiles_ShouldReturnAllFiles()
166166 { XFS . Path ( @"c:\temp\folder\deeper\d.txt" ) , "" }
167167 } ) ;
168168
169- // Act
170- var directoryInfo = new MockDirectoryInfo ( fileSystem , XFS . Path ( @"c:\temp\folder" ) ) ;
169+ // Act
170+ var directoryInfo = new MockDirectoryInfo ( fileSystem , XFS . Path ( @"c:\temp\folder" ) ) ;
171171
172- // Assert
173- Assert . AreEqual ( new [ ] { "b.txt" , "c.txt" } , directoryInfo . EnumerateFiles ( ) . ToList ( ) . Select ( x => x . Name ) . ToArray ( ) ) ;
172+ // Assert
173+ Assert . AreEqual ( new [ ] { "b.txt" , "c.txt" } , directoryInfo . EnumerateFiles ( ) . ToList ( ) . Select ( x => x . Name ) . ToArray ( ) ) ;
174174 }
175175
176176 [ Test ]
@@ -238,7 +238,7 @@ public void MockDirectoryInfo_Constructor_ShouldThrowArgumentNullException_IfArg
238238 var fileSystem = new MockFileSystem ( ) ;
239239
240240 // Act
241- TestDelegate action = ( ) => new MockDirectoryInfo ( fileSystem , null ) ;
241+ TestDelegate action = ( ) => new MockDirectoryInfo ( fileSystem , null ) ;
242242
243243 // Assert
244244 var exception = Assert . Throws < ArgumentNullException > ( action ) ;
@@ -272,20 +272,18 @@ public void MockDirectoryInfo_Constructor_ShouldThrowArgumentException_IfArgumen
272272 Assert . That ( exception . Message , Does . StartWith ( "The path is not of a legal form." ) ) ;
273273 }
274274
275- [ Test ]
276- public void MockDirectoryInfo_ToString_ShouldReturnDirectoryName ( )
275+ [ TestCase ( @"c:\temp\folder\folder" ) ]
276+ [ TestCase ( @"..\..\..\Desktop" ) ]
277+ public void MockDirectoryInfo_ToString_ShouldReturnDirectoryName ( string directoryName )
277278 {
278- var directoryPath = XFS . Path ( @"c:\temp\folder\folder" ) ;
279-
280279 // Arrange
281- var fileSystem = new MockFileSystem ( ) ;
282- var directoryInfo = new MockDirectoryInfo ( fileSystem , directoryPath ) ;
280+ var directoryPath = XFS . Path ( directoryName ) ;
283281
284282 // Act
285- var str = directoryInfo . ToString ( ) ;
283+ var mockDirectoryInfo = new MockDirectoryInfo ( new MockFileSystem ( ) , directoryPath ) ;
286284
287285 // Assert
288- Assert . AreEqual ( directoryPath , str ) ;
286+ Assert . AreEqual ( directoryPath , mockDirectoryInfo . ToString ( ) ) ;
289287 }
290288 }
291289}
0 commit comments