Skip to content
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

Should: Use Generic.List[PSObject] instead of ArrayList for $inputArray #1144

merged 1 commit into from Dec 14, 2018


Copy link

commented Nov 8, 2018

1. General summary of the pull request

Refactor code slightly in Should command. Documentation for ArrayList explicitly states that Generic.List[T] should be used instead:

We don't recommend that you use the ArrayList class for new development. Instead, we recommend that you use the generic List<T> class.

This allows us to drop the $null = output-swallowing construct for part of the function, as List[T] does not emit output on .Add().

Additionally, typing the List with [PSObject] avoids some extremely edge case problems that can occur with reboxing PSObjects that have instance members attached (such as those added via Add-Member).

@nohwnd nohwnd merged commit e32b3a1 into pester:master Dec 14, 2018

1 of 2 checks passed

Publish Status to GitHub (Pester) TeamCity build failed
continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Copy link

commented Dec 14, 2018


@vexx32 vexx32 deleted the vexx32:Fix-Should branch Dec 14, 2018


This comment has been minimized.

Copy link
Contributor Author

commented Dec 14, 2018

You're Welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.