Files
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1
T
James Truher 9e225ccae2 changes tags for tests
Start using tags CI, Feature, Scenario
2016-07-27 12:06:51 -07:00

29 lines
924 B
PowerShell

Describe "Start-Sleep DRT Unit Tests" -Tags "CI" {
It "Should be works properly when sleeping with Second" {
$dtStart = [DateTime]::Now
Start-Sleep -Seconds 1
$dtEnd = [DateTime]::Now
$millseconds = (New-TimeSpan -Start $dtStart -End $dtEnd).TotalMilliseconds
$millseconds | Should BeGreaterThan 1000
}
It "Should be works properly when sleeping with Milliseconds" {
$dtStart = [DateTime]::Now
Start-Sleep -Milliseconds 1000
$dtEnd = [DateTime]::Now
$millseconds = (New-TimeSpan -Start $dtStart -End $dtEnd).TotalMilliseconds
$millseconds | Should BeGreaterThan 1000
}
}
Describe "Start-Sleep" -Tags "CI" {
Context "Validate Start-Sleep works properly" {
It "Should only sleep for at least 1 second" {
$result = Measure-Command { Start-Sleep -s 1 }
$result.TotalSeconds | Should BeGreaterThan 0.25
}
}
}