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

xWebAdministration: Stubs for unit tests should throw if they are called #351

Closed
johlju opened this issue May 1, 2018 · 0 comments · Fixed by #620
Closed

xWebAdministration: Stubs for unit tests should throw if they are called #351

johlju opened this issue May 1, 2018 · 0 comments · Fixed by #620
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented May 1, 2018

When the stubs are called, they are executed and nothing happens. They should instead throw an error saying that Stub was called. This way it is shown that a cmdlet wasn't mocked correctly. If cmdlets are not mocked correctly then when user expecting to run unit tests on a lab it could actually change the system that only an integration test should do.

All stub functions here:
https://github.com/PowerShell/xWebAdministration/blob/dev/Tests/MockWebAdministrationWindowsFeature.psm1

Should throw something like this.

throw '{0}: StubNotImplemented' -f $MyInvocation.MyCommand
@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels May 1, 2018
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
1 participant