-
-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing -Not parameter in new Should- assertions #2550
Comments
I don't disagree on the function bloat and 90% help duplication etc. though we have to find a balance. Personally I'm struggling a bit with testcases modifying the assertion behavior like @nohwnd What's your thoughts on the current design for Not/Negate? |
I have the same opinion as you @fflaten. controlling whether the assertion will or will not be negated from the test seems like a code smell. A code smell that is sometimes necessary and makes stuff easier, but that should be (and from experience is) an exceptional case. And probably should not drive our design. I also wanted to avoid adding an implicit I find it better to have a special function that has its own help and examples for the negative case, because often the negative assertion is either not needed, or much simpler than the positive one. (e.g. GreaterOrEqualThan vs LessThan, but not GreaterOrEqualThan vs NotGreaterOrEqualThan, and Should-HaveParameter -Name abc -Mandatory, vs Should-NotHaveParameter abc (and no additional checks like is mandatory, and so on, because we primarily check that the parameter is not present)). This of course can be to some extent modelled by not forcing the parameter on the assertion, and using parameters sets, but to me it reads worse with -Not parameter, and so I decided to take the other route. We are still in alpha though, so let's discuss further :) |
Originally posted by @DarkLite1 in #2533 (comment)
Originally posted by @fflaten in #2533 (comment)
Originally posted by @DarkLite1 in #2533 (comment)
The text was updated successfully, but these errors were encountered: