Checklist
Summary of the feature request
Should assertions like Should-ContainCollection have an option to ignore item order? Sometimes the returned order can not be guaranteed, especially in integration tests.
This is especially visible when migrating from Should -BeIn which checked individual items in the expected collection.
'a',2,$null | Should -BeIn 'b',3,2,'a',$null
# pass
'b',3,2,'a',$null | Should-ContainCollection 'a',2,$null
Expected [Object[]] @('a', 2, $null) to be present in [Object[]] @('b', 3, 2, 'a', $null), but it was not there.
'b',3,2,'a',$null | Sort-Object | Should-ContainCollection ('a',2,$null | Sort-Object)
# pass but ugly
How should it work?
-IgnoreOrder parameter?
Or close request and let this issue document the required use of Sort-Object.
Checklist
Summary of the feature request
Should assertions like
Should-ContainCollectionhave an option to ignore item order? Sometimes the returned order can not be guaranteed, especially in integration tests.This is especially visible when migrating from
Should -BeInwhich checked individual items in the expected collection.How should it work?
-IgnoreOrderparameter?Or close request and let this issue document the required use of
Sort-Object.