11using System ;
2- using System . Collections . Generic ;
32using System . IO ;
43using System . Linq ;
54using System . Threading . Tasks ;
@@ -217,7 +216,7 @@ public void WhenDirectoryExist_ExpectContents()
217216 //---------------Act----------------------
218217 var result = sut . List ( path ) ;
219218 //---------------Assert-----------------------
220- result . Count ( ) . Should ( ) . BeGreaterOrEqualTo ( 1 ) ;
219+ result . Count ( ) . Should ( ) . BeGreaterThanOrEqualTo ( 1 ) ;
221220 }
222221
223222 [ Test ]
@@ -467,9 +466,10 @@ public async Task GivenFileExist_ExpectDocumentWithBytesReturned()
467466 //---------------Assert-----------------------
468467 var expectedFirst = "GlobalRank,TldRank,Domain,TLD,RefSubNets,RefIPs,IDN_Domain,IDN_TLD,PrevGlobalRank,PrevTldRank,PrevRefSubNets,PrevRefIPs" ;
469468 var expectedLast = "1000000,499336,alexandrevicenzi.com,com,341,364,alexandrevicenzi.com,com,982364,490355,345,368" ;
470- actual . Count ( ) . Should ( ) . Be ( 1000001 ) ;
471- actual . FirstOrDefault ( ) . Should ( ) . BeEquivalentTo ( expectedFirst ) ;
472- actual . LastOrDefault ( ) . Should ( ) . BeEquivalentTo ( expectedLast ) ;
469+ var enumerable = actual as string [ ] ?? actual . ToArray ( ) ;
470+ enumerable . Count ( ) . Should ( ) . Be ( 1000001 ) ;
471+ enumerable . FirstOrDefault ( ) . Should ( ) . BeEquivalentTo ( expectedFirst ) ;
472+ enumerable . LastOrDefault ( ) . Should ( ) . BeEquivalentTo ( expectedLast ) ;
473473 }
474474
475475 [ Test ]
@@ -482,7 +482,7 @@ public void GivenFileDoesExist_ExpectException()
482482 //---------------Act----------------------
483483 var actual = Assert . ThrowsAsync < FileNotFoundException > ( async ( ) => await sut . ReadAllLines ( path ) ) ;
484484 //---------------Assert-----------------------
485- actual . Message . Should ( ) . NotBeEmpty ( ) ;
485+ actual ? . Message . Should ( ) . NotBeEmpty ( ) ;
486486 }
487487
488488 [ Test ]
@@ -493,7 +493,7 @@ public void GivenNullPath_ExpectException()
493493 //---------------Act----------------------
494494 var actual = Assert . ThrowsAsync < ArgumentNullException > ( async ( ) => await sut . ReadAllLines ( null ) ) ;
495495 //---------------Assert-----------------------
496- actual . Message . Should ( ) . NotBeEmpty ( ) ;
496+ actual ? . Message . Should ( ) . NotBeEmpty ( ) ;
497497 }
498498 }
499499
0 commit comments