Checklist
I've this kind of v5 test:
It "should do something" -ForEach @(
@{ Value = ""; Length = 0; Expected = "" }
@{ Value = "foo bar"; Length = 3; Expected = "foo" }
) {
Format-String $value -Truncate -Length $length | Should -BeExactly $expected
}
When porting it to v6, I now must use:
It "should do something" -ForEach @(
@{ Value = ""; Length = 0; Expected = "" }
@{ Value = "foo bar"; Length = 3; Expected = "foo" }
) {
$actual = Format-String $value -Truncate -Length $length
if ($expected) { Should-BeString $expected $actual -CaseSensitive }
else { Should-BeEmptyString $actual }
}
I would have preferred not to have to use two different assertions depending on whether the expected value is an empty string or not.
Checklist
I've this kind of v5 test:
When porting it to v6, I now must use:
I would have preferred not to have to use two different assertions depending on whether the expected value is an empty string or not.