1+ using System ;
12using System . IO ;
23using System . Text ;
34using System . Threading . Tasks ;
@@ -24,7 +25,7 @@ public async Task NoMatchedRules_CrawlDelayNotSpecified_DefaultCrawlDelay()
2425 // Assert
2526 robotsTxt . Should ( ) . NotBe ( null ) ;
2627 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( false ) ;
27- crawlDelay . Should ( ) . Be ( 0 ) ;
28+ crawlDelay . Should ( ) . Be ( TimeSpan . Zero ) ;
2829 }
2930
3031 [ Fact ]
@@ -43,7 +44,7 @@ public async Task WildcardUserAgent_CrawlDelayNotSpecified_DefaultCrawlDelay()
4344 // Assert
4445 robotsTxt . Should ( ) . NotBe ( null ) ;
4546 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( false ) ;
46- crawlDelay . Should ( ) . Be ( 0 ) ;
47+ crawlDelay . Should ( ) . Be ( TimeSpan . Zero ) ;
4748 }
4849
4950 [ Fact ]
@@ -62,7 +63,7 @@ public async Task WildcardUserAgent_CrawlDelaySpecified_ReturnCrawlDelay()
6263 // Assert
6364 robotsTxt . Should ( ) . NotBe ( null ) ;
6465 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( true ) ;
65- crawlDelay . Should ( ) . Be ( 10 ) ;
66+ crawlDelay . Should ( ) . Be ( TimeSpan . FromSeconds ( 10 ) ) ;
6667 }
6768
6869 [ Fact ]
@@ -81,7 +82,7 @@ public async Task WildcardUserAgent_NonStandardCaseCrawlDelaySpecified_ReturnCra
8182 // Assert
8283 robotsTxt . Should ( ) . NotBe ( null ) ;
8384 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( true ) ;
84- crawlDelay . Should ( ) . Be ( 10 ) ;
85+ crawlDelay . Should ( ) . Be ( TimeSpan . FromSeconds ( 10 ) ) ;
8586 }
8687
8788 [ Fact ]
@@ -103,7 +104,7 @@ public async Task MatchedUserAgent_NoCrawlDelaySpecified_DefaultCrawlDelay()
103104 // Assert
104105 robotsTxt . Should ( ) . NotBe ( null ) ;
105106 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( false ) ;
106- crawlDelay . Should ( ) . Be ( 0 ) ;
107+ crawlDelay . Should ( ) . Be ( TimeSpan . Zero ) ;
107108 }
108109
109110 [ Fact ]
@@ -125,7 +126,7 @@ public async Task MatchedUserAgent_CrawlDelaySpecified_ReturnCrawlDelay()
125126 // Assert
126127 robotsTxt . Should ( ) . NotBe ( null ) ;
127128 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( true ) ;
128- crawlDelay . Should ( ) . Be ( 5 ) ;
129+ crawlDelay . Should ( ) . Be ( TimeSpan . FromSeconds ( 5 ) ) ;
129130 }
130131
131132 [ Fact ]
@@ -148,7 +149,7 @@ public async Task MatchedMultiLineUserAgent_NoCrawlDelaySpecified_DefaultCrawlDe
148149 // Assert
149150 robotsTxt . Should ( ) . NotBe ( null ) ;
150151 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( false ) ;
151- crawlDelay . Should ( ) . Be ( 0 ) ;
152+ crawlDelay . Should ( ) . Be ( TimeSpan . Zero ) ;
152153 }
153154
154155 [ Fact ]
@@ -171,7 +172,7 @@ public async Task MatchedMultiLineUserAgent_CrawlDelaySpecified_ReturnCrawlDelay
171172 // Assert
172173 robotsTxt . Should ( ) . NotBe ( null ) ;
173174 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( true ) ;
174- crawlDelay . Should ( ) . Be ( 5 ) ;
175+ crawlDelay . Should ( ) . Be ( TimeSpan . FromSeconds ( 5 ) ) ;
175176 }
176177
177178 [ Fact ]
@@ -196,6 +197,6 @@ public async Task MatchedDuplicateGroupUserAgent_CrawlDelaySpecified_ReturnFirst
196197 // Assert
197198 robotsTxt . Should ( ) . NotBe ( null ) ;
198199 robotsTxt . TryGetCrawlDelay ( ProductToken . Parse ( "SomeBot" ) , out var crawlDelay ) . Should ( ) . Be ( true ) ;
199- crawlDelay . Should ( ) . Be ( 15 ) ;
200+ crawlDelay . Should ( ) . Be ( TimeSpan . FromSeconds ( 15 ) ) ;
200201 }
201202}
0 commit comments