From 52ba25be691876f54e5a0a8d78a43bb5286b867d Mon Sep 17 00:00:00 2001 From: James Truher Date: Wed, 24 Aug 2016 12:43:18 -0700 Subject: [PATCH] Add simple Enable-PSBreakpoint and Disable-PSBreakpoint cmdlet tests --- .../EnableDisablePSBreakpoint.Tests.ps1 | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 new file mode 100644 index 0000000000..cb8e693737 --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 @@ -0,0 +1,21 @@ +Describe "Enable and Disable PSBreakpoints" -Tag "CI" { + BeforeAll { + $path = Setup -F testbp.ps1 -content "get-command`nget-date`nget-location" -pass + $bp = set-psbreakpoint -script $path -line 2 + disable-psbreakpoint $bp + } + AfterAll { + $bp | remove-psbreakpoint + } + It "Enable-PSBreakpoint should enable the breakpoint" { + $bp.Enabled | should be $false + Enable-PSBreakpoint $bp + $bp.Enabled | Should be $true + } + It "Disable-PSBreakpoint should disable the breakpoint" { + Enable-PSBreakpoint $bp + $bp.Enabled | Should be $true + Disable-PSBreakpoint $bp + $bp.Enabled | Should be $false + } +}