Skip to content

Commit

Permalink
adjusted integration delay
Browse files Browse the repository at this point in the history
  • Loading branch information
techthoughts2 committed Jan 15, 2024
1 parent fab1b0f commit 91ea43b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/Tests/Integration/pwshPlaces-Infra.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Describe 'Integration Tests' -Tag Integration {
# $env:GoogleAPIKey = ''
# $env:BingAPIKey = ''
# }
BeforeEach {
Start-Sleep -Milliseconds (Get-Random -Minimum 550 -Maximum 1550)
}
Context 'Google Maps Function Tests' {

Context 'Find-GMapPlace' {
Expand All @@ -34,7 +37,7 @@ Describe 'Integration Tests' -Tag Integration {
$eval.name | Should -BeExactly "Krause's Cafe"
$eval.Open | Should -Not -BeNullOrEmpty
$eval.rating | Should -Not -BeNullOrEmpty
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Find-GMapPlace
Expand Down Expand Up @@ -64,7 +67,7 @@ Describe 'Integration Tests' -Tag Integration {
$eval.price_level | Should -Not -BeNullOrEmpty
$eval.Latitude | Should -Not -BeNullOrEmpty
$eval.Longitude | Should -Not -BeNullOrEmpty
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Get-GMapPlaceDetails
Expand All @@ -78,7 +81,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Invoke-GMapGeoCode @invokeGMapGeoCodeSplat
($eval.place_id | Measure-Object).Count | Should -BeGreaterOrEqual 1
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

It 'should return the expected results for reverse geocoding' {
Expand All @@ -89,7 +92,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Invoke-GMapGeoCode @invokeGMapGeoCodeSplat
($eval.place_id | Measure-Object).Count | Should -BeGreaterOrEqual 1
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

It 'should return expected results for place lookup' {
Expand All @@ -102,7 +105,7 @@ Describe 'Integration Tests' -Tag Integration {
$eval.City | Should -BeExactly 'New Braunfels'
$eval.Latitude | Should -Not -BeNullOrEmpty
$eval.Longitude | Should -Not -BeNullOrEmpty
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Invoke-GMapGeoCode
Expand All @@ -125,7 +128,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Search-GMapNearbyPlace @searchGMapNearbyPlaceSplat
($eval.place_id | Measure-Object).Count | Should -BeGreaterOrEqual 2
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Search-GMapNearbyPlace
Expand All @@ -147,7 +150,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Search-GMapText @searchGMapTextSplat
($eval.place_id | Measure-Object).Count | Should -BeGreaterOrEqual 8
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Search-GMapText
Expand All @@ -167,7 +170,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Invoke-BingGeoCode @invokeBingGeoCodeSplat
($eval.name | Measure-Object).Count | Should -BeGreaterOrEqual 1
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

It 'should return the expected results for reverse geocoding' {
Expand All @@ -178,7 +181,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Invoke-BingGeoCode @invokeBingGeoCodeSplat
($eval.name | Measure-Object).Count | Should -BeGreaterOrEqual 1
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Invoke-GMapGeoCode
Expand All @@ -196,7 +199,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Find-BingPlace @findBingPlaceSplat
($eval.name | Measure-Object).Count | Should -BeGreaterOrEqual 1
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Find-BingPlace
Expand All @@ -214,7 +217,7 @@ Describe 'Integration Tests' -Tag Integration {
}
$eval = Search-BingNearbyPlace @searchBingNearbyPlaceSplat
($eval.name | Measure-Object).Count | Should -BeGreaterOrEqual 1
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Find-BingPlace
Expand All @@ -232,7 +235,7 @@ Describe 'Integration Tests' -Tag Integration {
$eval.TimeZoneShort | Should -BeExactly 'CST'
$eval.dstRule.dstStartMonth | Should -BeExactly 'Mar'
$eval.dstRule.dstEndMonth | Should -BeExactly 'Nov'
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

It 'should return the expected results for point' {
Expand All @@ -247,7 +250,7 @@ Describe 'Integration Tests' -Tag Integration {
$eval.TimeZoneShort | Should -BeExactly 'CST'
$eval.dstRule.dstStartMonth | Should -BeExactly 'Mar'
$eval.dstRule.dstEndMonth | Should -BeExactly 'Nov'
Start-Sleep -Milliseconds (Get-Random -Minimum 250 -Maximum 1000)

} #it

} #context_Find-BingPlace
Expand Down

0 comments on commit 91ea43b

Please # to comment.