MegaBites-AI/Windows-powershell
0372
1# Copyright (c) Microsoft Corporation.2# Licensed under the MIT License.3 4Describe "Update-List Tests" -Tag CI {5 BeforeEach {6 $testObj = [pscustomobject]@{a = [System.Collections.ArrayList]::new(@(1,2,3))}7 }8 9 10 It "-Add works" {11 $testObj | Update-List -Property a -Add 412 $testObj.A | Should -Be 1,2,3,413 }14 15 It "-Remove works" {16 Update-List -InputObject $testObj -Property a -Remove 217 $testObj.A | Should -Be 1,318 }19 20 It "-Add with -Remove works" {21 $testObj | Update-List -Property a -Remove 2 -Add 422 $testObj.A | Should -Be 1,3,423 }24 25 It "-Replace works" {26 $testObj | Update-List -Property a -Replace 2,427 $testObj.A | Should -Be 2,428 }29}30 