Do not require activity when creating a completed progress record (#18474)

This commit is contained in:
MartinGC94 authored and GitHub committed 2023-06-19 16:20:08 -07:00
1 parent 994e43b1bf
commit 15213d8494
3 files changed
+52 -8

No files matched your search

@@ -1,10 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "Write-Progress DRT Unit Tests" -Tags "CI" {
It "Should be able to throw exception when missing mandatory parameters" {
{ Write-Progress $null } | Should -Throw -ErrorId 'ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.WriteProgressCommand'
}
It "Should be able to throw exception when running Write-Progress with bad percentage" {
{ Write-Progress -Activity 'myactivity' -Status 'mystatus' -percent 101 } |
Should -Throw -ErrorId 'ParameterArgumentValidationError,Microsoft.PowerShell.Commands.WriteProgressCommand'
@@ -33,4 +29,8 @@ Describe "Write-Progress DRT Unit Tests" -Tags "CI" {
{ Write-Progress -Activity $activity -Status ('b' * ([console]::WindowWidth + 1)) -Id 1 } | Should -Not -Throw
Write-Progress -Activity $activity -Id 1 -Completed
}
It 'Should be able to complete a progress record with no activity specified' {
{ Write-Progress -Completed } | Should -Not -Throw
}
}