mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add Unit Test for StartSleepTest.cs
This commit is contained in:
@@ -1,3 +1,22 @@
|
||||
Describe "Start-Sleep DRT Unit Tests" -Tags DRT{
|
||||
It "Shoule 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 "Shoule be works properly when sleeping with Second" {
|
||||
$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" {
|
||||
|
||||
Context "Validate Start-Sleep works properly" {
|
||||
|
||||
Reference in New Issue
Block a user