I’ve tried testing, and it’s stating this under every test:
Message: This test should run but it did not. Most likely a setup in some parent block failed.
Stack-trace:
Here is my code:
Function Get-BobResponse ([string]$HeyBob) {
$HeyBob = $HeyBob.Trim()
If ($HeyBob.ToUpper() -ceq $HeyBob) -and ($HeyBob -cmatch "[A-Za-z]") {
$Shouting = $True
} ElseIf ($HeyBob[$HeyBob.Length - 1] -eq "?") {
$Question = $true
} ElseIf ([string]::IsNullOrEmpty($HeyBob)) {
$SaidNothing = $True
} ElseIf ($SaidNothing) {
Return "Fine. Be that way"
} ElseIf ($Question -and $Shouting) {
Return "Calm down, I know what I'm doing!"
} Elseif ($Question) {
Return "Sure."
} ElseIf ($Shouting) {
Return "Whoa, chill out!"
} Else {
Return "Whatever."
}
}
Any help is much appreciated. Thanks!