diff --git a/Code/Functions/Public/Write-CUPesterTest.ps1 b/Code/Functions/Public/Write-CUPesterTest.ps1 index 3abf3e5..ae21e4f 100644 --- a/Code/Functions/Public/Write-CUPesterTest.ps1 +++ b/Code/Functions/Public/Write-CUPesterTest.ps1 @@ -375,7 +375,7 @@ Function Write-CUPesterTest { [void]$sb.AppendLine($visibility) - If ($Method.ReturnType -eq '[void]' -or $Null -eq $Method.ReturnType) { + If (!($Method.ReturnType) -or $Method.ReturnType -eq '[void]') { [void]$sb.AppendLine("It '[$($Class.Name)] --> $($Method.Name)$($Signature) Should not return anything (voided)' {") } else { @@ -422,12 +422,12 @@ Function Write-CUPesterTest { [void]$sb.AppendLine("# -- Assert") [void]$sb.AppendLine("") - If ($Method.ReturnType -eq '[void]' -or $Null -eq $Method.ReturnType) { - [void]$sb.AppendLine("$MethodCall" + '| should be $null') + If (!($Method.ReturnType) -or $Method.ReturnType -eq '[void]') { + [void]$sb.AppendLine("$MethodCall" + '| Should -Be $null') } else { - [void]$sb.AppendLine("($MethodCall).GetType().Name | should be $ReturnType") + [void]$sb.AppendLine("($MethodCall).GetType().Name | Should -Be $ReturnType") }