mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Modify Pester Test for Get-PSBreakpoint
This commit is contained in:
1 parent
6be57a0b5c
commit
25f8d334d6
1 file changed
+8
-7
@@ -1,27 +1,28 @@
|
||||
Describe "Get-PSBreakpoint" {
|
||||
|
||||
$scriptName = "Get-PSBreakpoint.Tests.ps1"
|
||||
$fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName
|
||||
|
||||
AfterEach {
|
||||
Get-PSBreakpoint -Script "$PSScriptRoot\$scriptName" | Remove-PSBreakpoint
|
||||
Get-PSBreakpoint -Script $fullScriptPath | Remove-PSBreakpoint
|
||||
}
|
||||
|
||||
It "should be able to get PSBreakpoint with using Id switch" {
|
||||
Set-PSBreakpoint -Script "$PSScriptRoot\$scriptName" -Line 1
|
||||
Set-PSBreakpoint -Script $fullScriptPath -Line 1
|
||||
|
||||
{ Get-PSBreakpoint -Script "$PSScriptRoot\$scriptName" } | Should Not Throw
|
||||
{ Get-PSBreakpoint -Script $fullScriptPath } | Should Not Throw
|
||||
|
||||
$Id = (Get-PSBreakpoint -Script "$PSScriptRoot\$scriptName").Id
|
||||
$Id = (Get-PSBreakpoint -Script $fullScriptPath).Id
|
||||
$Id | Should be 0
|
||||
|
||||
}
|
||||
|
||||
It "sshould be able to get PSBreakpoint with using Variable switch" {
|
||||
Set-PSBreakpoint -Script "$PSScriptRoot\$scriptName" -Variable "$scriptName"
|
||||
Set-PSBreakpoint -Script $fullScriptPath -Variable "$scriptName"
|
||||
|
||||
{ Get-PSBreakpoint -Variable "$scriptName" -Script "$PSScriptRoot\$scriptName" } | Should Not Throw
|
||||
{ Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath } | Should Not Throw
|
||||
|
||||
$Id = (Get-PSBreakpoint -Variable "$scriptName" -Script "$PSScriptRoot\$scriptName").Variable
|
||||
$Id = (Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath).Variable
|
||||
$Id | Should be $scriptName
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user