@@ -59,7 +59,7 @@ public async Task ReadFileAsync_NonExistentFile_ReturnsFileNotFoundError()
5959 // Assert
6060 Assert . False ( result . Success ) ;
6161 Assert . Single ( result . Errors ) ;
62- Assert . Equal ( ErrorType . FileNotFound , result . Errors [ 0 ] . Type ) ;
62+ Assert . Equal ( ErrorType . FileNotFound , result . Errors . First ( ) . Type ) ;
6363 }
6464
6565 [ Fact ]
@@ -71,7 +71,7 @@ public async Task ReadFileAsync_NullPath_ReturnsInvalidPathError()
7171 // Assert
7272 Assert . False ( result . Success ) ;
7373 Assert . Single ( result . Errors ) ;
74- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
74+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
7575 }
7676
7777 [ Fact ]
@@ -83,7 +83,7 @@ public async Task ReadFileAsync_EmptyPath_ReturnsInvalidPathError()
8383 // Assert
8484 Assert . False ( result . Success ) ;
8585 Assert . Single ( result . Errors ) ;
86- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
86+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
8787 }
8888
8989 [ Fact ]
@@ -95,7 +95,7 @@ public async Task ReadFileAsync_WhitespacePath_ReturnsInvalidPathError()
9595 // Assert
9696 Assert . False ( result . Success ) ;
9797 Assert . Single ( result . Errors ) ;
98- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
98+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
9999 }
100100
101101 [ Fact ]
@@ -161,7 +161,7 @@ public async Task ReadFileAsync_FileExceedsSizeLimit_ReturnsFileSizeExceededErro
161161 // Assert
162162 Assert . False ( result . Success ) ;
163163 Assert . Single ( result . Errors ) ;
164- Assert . Equal ( ErrorType . FileSizeExceeded , result . Errors [ 0 ] . Type ) ;
164+ Assert . Equal ( ErrorType . FileSizeExceeded , result . Errors . First ( ) . Type ) ;
165165 }
166166
167167 #endregion
@@ -198,7 +198,7 @@ public async Task WriteFileAsync_ExistingFileWithoutForce_ReturnsFileExistsError
198198 // Assert
199199 Assert . False ( result . Success ) ;
200200 Assert . Single ( result . Errors ) ;
201- Assert . Equal ( ErrorType . FileExists , result . Errors [ 0 ] . Type ) ;
201+ Assert . Equal ( ErrorType . FileExists , result . Errors . First ( ) . Type ) ;
202202
203203 // Verify original content is unchanged
204204 var actualContent = await File . ReadAllTextAsync ( filePath ) ;
@@ -270,7 +270,7 @@ public async Task WriteFileAsync_NullPath_ReturnsInvalidPathError()
270270 // Assert
271271 Assert . False ( result . Success ) ;
272272 Assert . Single ( result . Errors ) ;
273- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
273+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
274274 }
275275
276276 [ Fact ]
@@ -282,7 +282,7 @@ public async Task WriteFileAsync_EmptyPath_ReturnsInvalidPathError()
282282 // Assert
283283 Assert . False ( result . Success ) ;
284284 Assert . Single ( result . Errors ) ;
285- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
285+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
286286 }
287287
288288 [ Fact ]
@@ -297,7 +297,7 @@ public async Task WriteFileAsync_NullContent_ReturnsProcessingError()
297297 // Assert
298298 Assert . False ( result . Success ) ;
299299 Assert . Single ( result . Errors ) ;
300- Assert . Equal ( ErrorType . ProcessingError , result . Errors [ 0 ] . Type ) ;
300+ Assert . Equal ( ErrorType . ProcessingError , result . Errors . First ( ) . Type ) ;
301301 }
302302
303303 [ Fact ]
@@ -356,7 +356,7 @@ public void ValidatePath_NullPath_ReturnsInvalidPathError()
356356 // Assert
357357 Assert . False ( result . Success ) ;
358358 Assert . Single ( result . Errors ) ;
359- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
359+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
360360 }
361361
362362 [ Fact ]
@@ -368,7 +368,7 @@ public void ValidatePath_EmptyPath_ReturnsInvalidPathError()
368368 // Assert
369369 Assert . False ( result . Success ) ;
370370 Assert . Single ( result . Errors ) ;
371- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
371+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
372372 }
373373
374374 [ Fact ]
@@ -380,7 +380,7 @@ public void ValidatePath_WhitespacePath_ReturnsInvalidPathError()
380380 // Assert
381381 Assert . False ( result . Success ) ;
382382 Assert . Single ( result . Errors ) ;
383- Assert . Equal ( ErrorType . InvalidPath , result . Errors [ 0 ] . Type ) ;
383+ Assert . Equal ( ErrorType . InvalidPath , result . Errors . First ( ) . Type ) ;
384384 }
385385
386386 [ Fact ]
@@ -395,7 +395,7 @@ public void ValidatePath_WithStrictMode_DotsInPath_ReturnsPathTraversalError()
395395 // Assert
396396 Assert . False ( result . Success ) ;
397397 Assert . Single ( result . Errors ) ;
398- Assert . Equal ( ErrorType . PathTraversalAttempt , result . Errors [ 0 ] . Type ) ;
398+ Assert . Equal ( ErrorType . PathTraversalAttempt , result . Errors . First ( ) . Type ) ;
399399 }
400400
401401 [ Fact ]
@@ -410,7 +410,7 @@ public void ValidatePath_WithStrictMode_TildeInPath_ReturnsPathTraversalError()
410410 // Assert
411411 Assert . False ( result . Success ) ;
412412 Assert . Single ( result . Errors ) ;
413- Assert . Equal ( ErrorType . PathTraversalAttempt , result . Errors [ 0 ] . Type ) ;
413+ Assert . Equal ( ErrorType . PathTraversalAttempt , result . Errors . First ( ) . Type ) ;
414414 }
415415
416416 [ Fact ]
@@ -473,7 +473,7 @@ public async Task CheckFileSize_ExceedsLimit_ReturnsFileSizeExceededError()
473473 // Assert
474474 Assert . False ( result . Success ) ;
475475 Assert . Single ( result . Errors ) ;
476- Assert . Equal ( ErrorType . FileSizeExceeded , result . Errors [ 0 ] . Type ) ;
476+ Assert . Equal ( ErrorType . FileSizeExceeded , result . Errors . First ( ) . Type ) ;
477477 }
478478
479479 [ Fact ]
@@ -503,7 +503,7 @@ public void CheckFileSize_NonExistentFile_ReturnsFileNotFoundError()
503503 // Assert
504504 Assert . False ( result . Success ) ;
505505 Assert . Single ( result . Errors ) ;
506- Assert . Equal ( ErrorType . FileNotFound , result . Errors [ 0 ] . Type ) ;
506+ Assert . Equal ( ErrorType . FileNotFound , result . Errors . First ( ) . Type ) ;
507507 }
508508
509509 [ Fact ]
@@ -535,7 +535,7 @@ public async Task CheckFileSize_CustomLimit_Exceeds()
535535 // Assert
536536 Assert . False ( result . Success ) ;
537537 Assert . Single ( result . Errors ) ;
538- Assert . Equal ( ErrorType . FileSizeExceeded , result . Errors [ 0 ] . Type ) ;
538+ Assert . Equal ( ErrorType . FileSizeExceeded , result . Errors . First ( ) . Type ) ;
539539 }
540540
541541 [ Fact ]
0 commit comments