nohwnd / Assert

A set of advanced assertions for Pester to simplify how you write tests.
MIT License
101 stars 12 forks source link

What is the expected behavior of Assert-False? #8

Closed nohwnd closed 6 years ago

nohwnd commented 7 years ago

How should the Assert-False behave to be most useful?

1) Should it be really strict and only pass when provided with a boolean $false? if ($actual -is [bool] -and $false -eq $actual) {throw}

2) Should it be more forgiving and pass when given falsey value ($false, 0, "", $null, @())? if ($actual) {throw}

3) Should it fail for $null but pass for some other falsey values? if ($false -ne $actual) {throw}

Probably combination of all is permissible, but community should share it's opinion before I overload this with switches. The current behavior is 2).

mrbodean commented 7 years ago

If if(!($actual)){} is how my code is testing for a false value then the Assert-False should as well

nohwnd commented 6 years ago

Okay keeping it as it is.