mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Modify Set-PSBreakpoint.Tests.ps1 and fix 3 pending tests
This commit is contained in:
1 parent
2f60586602
commit
7a99b885da
1 file changed
+10
-32
@@ -1,3 +1,5 @@
|
||||
$ps = Join-Path -Path $PsHome -ChildPath "powershell"
|
||||
|
||||
Describe "Set-PSBreakpoint DRT Unit Tests" -Tags DRT{
|
||||
#Set up
|
||||
$scriptFileName = Join-Path $TestDrive -ChildPath breakpointTestScript.ps1
|
||||
@@ -84,30 +86,14 @@ set-psbreakpoint -command foo
|
||||
Remove-PSBreakPoint -Id $brk.Id
|
||||
}
|
||||
|
||||
# Marking as Pending tracking in Issue #829
|
||||
It "Should be throw Exception when missing mandatory parameter -line" -Pending {
|
||||
$ErrorActionPreference = "Stop"
|
||||
try {
|
||||
powershell.exe -noninteractive -command 'sbp -column 1' -script $scriptFileName
|
||||
Throw "Execution OK"
|
||||
}
|
||||
catch {
|
||||
$_.FullyQualifiedErrorId | Should Be "MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetPSBreakpointCommand"
|
||||
}
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
It "Should throw Exception when missing mandatory parameter -line"{
|
||||
$output = & $ps -noninteractive -command "sbp -column 1 -script $scriptFileName"
|
||||
[system.string]::Join(" ", $output) | Should Match "MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetPSBreakpointCommand"
|
||||
}
|
||||
|
||||
# Marking as Pending tracking in Issue #829
|
||||
It "Should be throw Exception when missing mandatory parameter" -Pending {
|
||||
$ErrorActionPreference = "Stop"
|
||||
try {
|
||||
powershell.exe -noninteractive -command 'sbp -line 1'
|
||||
Throw "Execution OK"
|
||||
}
|
||||
catch {
|
||||
$_.FullyQualifiedErrorId | Should Be "MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetPSBreakpointCommand"
|
||||
}
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
It "Should throw Exception when missing mandatory parameter" {
|
||||
$output = & $ps -noninteractive -command "sbp -line 1"
|
||||
[system.string]::Join(" ", $output) | Should Match "MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetPSBreakpointCommand"
|
||||
}
|
||||
|
||||
It "Should be able to set psbreakpoints for -command" {
|
||||
@@ -172,16 +158,8 @@ set-psbreakpoint -command foo
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
}
|
||||
|
||||
# Marking as Pending tracking in Issue #829
|
||||
It "Remove implicit script from 'set-psbreakpoint -script'" -Pending {
|
||||
if ($IsLinux)
|
||||
{
|
||||
powershell $scriptFileNameBug
|
||||
}
|
||||
else
|
||||
{
|
||||
powershell.exe $scriptFileNameBug
|
||||
}
|
||||
It "Remove implicit script from 'set-psbreakpoint -script'" {
|
||||
& $ps $scriptFileNameBug
|
||||
|
||||
$breakpoint = Get-PSBreakpoint -Script $scriptFileNameBug
|
||||
$breakpoint | Should BeNullOrEmpty
|
||||
|
||||
Reference in new issue
Block a user