MegaBites-AI/Windows-powershell
0372
1# Copyright (c) Microsoft Corporation.2# Licensed under the MIT License.3Describe "Get-PSBreakpoint" -Tags "CI" {4 5 $scriptName = "Get-PSBreakpoint.Tests.ps1"6 $fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName7 8 AfterEach {9 Get-PSBreakpoint -Script $fullScriptPath | Remove-PSBreakpoint10 }11 12 It "should be able to get PSBreakpoint with using Id switch" {13 Set-PSBreakpoint -Script $fullScriptPath -Line 114 15 { Get-PSBreakpoint -Script $fullScriptPath } | Should -Not -Throw16 17 $Id = (Get-PSBreakpoint -Script $fullScriptPath).Id18 # if breakpoints have been set by other tests, the number may or may not be 019 # so we can't check against a specific number20 # however, we can be sure that we're getting an int and that the int is21 # greater or equal to 022 ([int]$Id) -ge 0 | Should -BeTrue23 }24 25 It "should be able to get PSBreakpoint with using Variable switch" {26 Set-PSBreakpoint -Script $fullScriptPath -Variable "$scriptName"27 28 { Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath } | Should -Not -Throw29 30 $Id = (Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath).Variable31 $Id | Should -Be $scriptName32 33 }34}35 36 