mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 20:56:02 +00:00
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files. Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks. Separate PR coming to update contribution document for new source files: #6140 Manually reviewed each change. Fix #6073
36 lines
1.3 KiB
PowerShell
36 lines
1.3 KiB
PowerShell
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
Describe "Get-PSBreakpoint" -Tags "CI" {
|
|
|
|
$scriptName = "Get-PSBreakpoint.Tests.ps1"
|
|
$fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName
|
|
|
|
AfterEach {
|
|
Get-PSBreakpoint -Script $fullScriptPath | Remove-PSBreakpoint
|
|
}
|
|
|
|
It "should be able to get PSBreakpoint with using Id switch" {
|
|
Set-PSBreakpoint -Script $fullScriptPath -Line 1
|
|
|
|
{ Get-PSBreakpoint -Script $fullScriptPath } | Should Not Throw
|
|
|
|
$Id = (Get-PSBreakpoint -Script $fullScriptPath).Id
|
|
# if breakpoints have been set by other tests, the number may or may not be 0
|
|
# so we can't check against a specific number
|
|
# however, we can be sure that we're getting an int and that the int is
|
|
# greater or equal to 0
|
|
([int]$Id) -ge 0 | should be $true
|
|
}
|
|
|
|
It "should be able to get PSBreakpoint with using Variable switch" {
|
|
Set-PSBreakpoint -Script $fullScriptPath -Variable "$scriptName"
|
|
|
|
{ Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath } | Should Not Throw
|
|
|
|
$Id = (Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath).Variable
|
|
$Id | Should be $scriptName
|
|
|
|
}
|
|
}
|
|
|