Skip to content

Commit

Permalink
Don't get none border
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunLawrie authored Mar 3, 2024
1 parent 88e8d59 commit 3a2afa9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions PwshSpectreConsole.Tests/TestHelpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ function Get-RandomString {
}

function Get-RandomBoxBorder {
param (
[switch] $MustNotBeNone
)
$lookup = [BoxBorder] | Get-Member -Static -MemberType Properties | Select-Object -ExpandProperty Name
if ($MustNotBeNone) {
$lookup = $lookup | Where-Object { $_ -ne 'None' }
}
return $lookup[$(Get-Random -Minimum 0 -Maximum $lookup.Count)]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Describe "Format-SpectrePanel" {
$testConsole.EmitAnsiSequences = $true
[Spectre.Console.Testing.TestConsoleExtensions]::Width($testConsole, 80)
$testTitle = Get-RandomString -MinimumLength 5 -MaximumLength 10
$testBorder = Get-RandomBoxBorder
$testBorder = Get-RandomBoxBorder -MustNotBeNone
$testExpand = $false
$testColor = Get-RandomColor

Expand Down

0 comments on commit 3a2afa9

Please sign in to comment.