@@ -15,6 +15,9 @@ Describe 'Integration Tests' -Tag Integration {
1515 # $env:GoogleAPIKey = ''
1616 # $env:BingAPIKey = ''
1717 # }
18+ BeforeEach {
19+ Start-Sleep - Milliseconds (Get-Random - Minimum 550 - Maximum 1550 )
20+ }
1821 Context ' Google Maps Function Tests' {
1922
2023 Context ' Find-GMapPlace' {
@@ -34,7 +37,7 @@ Describe 'Integration Tests' -Tag Integration {
3437 $eval.name | Should - BeExactly " Krause's Cafe"
3538 $eval.Open | Should -Not - BeNullOrEmpty
3639 $eval.rating | Should -Not - BeNullOrEmpty
37- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
40+
3841 } # it
3942
4043 } # context_Find-GMapPlace
@@ -64,7 +67,7 @@ Describe 'Integration Tests' -Tag Integration {
6467 $eval.price_level | Should -Not - BeNullOrEmpty
6568 $eval.Latitude | Should -Not - BeNullOrEmpty
6669 $eval.Longitude | Should -Not - BeNullOrEmpty
67- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
70+
6871 } # it
6972
7073 } # context_Get-GMapPlaceDetails
@@ -78,7 +81,7 @@ Describe 'Integration Tests' -Tag Integration {
7881 }
7982 $eval = Invoke-GMapGeoCode @invokeGMapGeoCodeSplat
8083 ($eval.place_id | Measure-Object ).Count | Should - BeGreaterOrEqual 1
81- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
84+
8285 } # it
8386
8487 It ' should return the expected results for reverse geocoding' {
@@ -89,7 +92,7 @@ Describe 'Integration Tests' -Tag Integration {
8992 }
9093 $eval = Invoke-GMapGeoCode @invokeGMapGeoCodeSplat
9194 ($eval.place_id | Measure-Object ).Count | Should - BeGreaterOrEqual 1
92- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
95+
9396 } # it
9497
9598 It ' should return expected results for place lookup' {
@@ -102,7 +105,7 @@ Describe 'Integration Tests' -Tag Integration {
102105 $eval.City | Should - BeExactly ' New Braunfels'
103106 $eval.Latitude | Should -Not - BeNullOrEmpty
104107 $eval.Longitude | Should -Not - BeNullOrEmpty
105- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
108+
106109 } # it
107110
108111 } # context_Invoke-GMapGeoCode
@@ -125,7 +128,7 @@ Describe 'Integration Tests' -Tag Integration {
125128 }
126129 $eval = Search-GMapNearbyPlace @searchGMapNearbyPlaceSplat
127130 ($eval.place_id | Measure-Object ).Count | Should - BeGreaterOrEqual 2
128- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
131+
129132 } # it
130133
131134 } # context_Search-GMapNearbyPlace
@@ -147,7 +150,7 @@ Describe 'Integration Tests' -Tag Integration {
147150 }
148151 $eval = Search-GMapText @searchGMapTextSplat
149152 ($eval.place_id | Measure-Object ).Count | Should - BeGreaterOrEqual 8
150- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
153+
151154 } # it
152155
153156 } # context_Search-GMapText
@@ -167,7 +170,7 @@ Describe 'Integration Tests' -Tag Integration {
167170 }
168171 $eval = Invoke-BingGeoCode @invokeBingGeoCodeSplat
169172 ($eval.name | Measure-Object ).Count | Should - BeGreaterOrEqual 1
170- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
173+
171174 } # it
172175
173176 It ' should return the expected results for reverse geocoding' {
@@ -178,7 +181,7 @@ Describe 'Integration Tests' -Tag Integration {
178181 }
179182 $eval = Invoke-BingGeoCode @invokeBingGeoCodeSplat
180183 ($eval.name | Measure-Object ).Count | Should - BeGreaterOrEqual 1
181- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
184+
182185 } # it
183186
184187 } # context_Invoke-GMapGeoCode
@@ -196,7 +199,7 @@ Describe 'Integration Tests' -Tag Integration {
196199 }
197200 $eval = Find-BingPlace @findBingPlaceSplat
198201 ($eval.name | Measure-Object ).Count | Should - BeGreaterOrEqual 1
199- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
202+
200203 } # it
201204
202205 } # context_Find-BingPlace
@@ -214,7 +217,7 @@ Describe 'Integration Tests' -Tag Integration {
214217 }
215218 $eval = Search-BingNearbyPlace @searchBingNearbyPlaceSplat
216219 ($eval.name | Measure-Object ).Count | Should - BeGreaterOrEqual 1
217- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
220+
218221 } # it
219222
220223 } # context_Find-BingPlace
@@ -232,7 +235,7 @@ Describe 'Integration Tests' -Tag Integration {
232235 $eval.TimeZoneShort | Should - BeExactly ' CST'
233236 $eval.dstRule.dstStartMonth | Should - BeExactly ' Mar'
234237 $eval.dstRule.dstEndMonth | Should - BeExactly ' Nov'
235- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
238+
236239 } # it
237240
238241 It ' should return the expected results for point' {
@@ -247,7 +250,7 @@ Describe 'Integration Tests' -Tag Integration {
247250 $eval.TimeZoneShort | Should - BeExactly ' CST'
248251 $eval.dstRule.dstStartMonth | Should - BeExactly ' Mar'
249252 $eval.dstRule.dstEndMonth | Should - BeExactly ' Nov'
250- Start-Sleep - Milliseconds ( Get-Random - Minimum 250 - Maximum 1000 )
253+
251254 } # it
252255
253256 } # context_Find-BingPlace
0 commit comments