Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Adding ValidateNotNullOrEmpty attribute to parameters listed in #2672#2685

Merged
lzybkr merged 1 commit into
PowerShell:masterPowerShell/PowerShell:masterfrom
dlwyatt:NewValidationAttributesdlwyatt/PowerShell:NewValidationAttributesCopy head branch name to clipboard
Dec 8, 2016
Merged

Adding ValidateNotNullOrEmpty attribute to parameters listed in #2672#2685
lzybkr merged 1 commit into
PowerShell:masterPowerShell/PowerShell:masterfrom
dlwyatt:NewValidationAttributesdlwyatt/PowerShell:NewValidationAttributesCopy head branch name to clipboard

Conversation

@dlwyatt

@dlwyatt dlwyatt commented Nov 15, 2016

Copy link
Copy Markdown
Contributor

Do changes to parameter metadata require tests? If so, should they be located with the tests for each individual command, or would it be sufficient to write a single It block with -TestCases to hit all of the affected commands in this issue / PR?

@SteveL-MSFT

Copy link
Copy Markdown
Member

I imagine we'd eventually have tests per cmdlet to keep it organized so I would prefer having individual tests scripts we would eventually build up for complete test coverage

CC @JamesWTruher

@HemantMahawar

Copy link
Copy Markdown
Contributor

@dlwyatt Agree with @SteveL-MSFT and that's the approach we have used with #2542 and #2545 as well.

@iSazonov

Copy link
Copy Markdown
Collaborator

Perhaps we should add the relevant comments in the Provider cmdlets why we don't fix them to block accidental changes in future.

@SteveL-MSFT SteveL-MSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get-Service -Name is missing

@dlwyatt

dlwyatt commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

Get-Service was already fixed in 6763854 .

@JamesWTruher

Copy link
Copy Markdown
Collaborator

i believe we do need tests against metadata changes. Strictly speaking we should really have tests which ensure that we have the proper parameters and that their configuration (type/attributes/etc) is correct.

@lzybkr

lzybkr commented Nov 18, 2016

Copy link
Copy Markdown
Contributor

@JamesWTruher - are you fine with accepting the PR without tests?

If we do add tests, I'd rather see that we test behaviors, e.g. that Get-Service -Name $null throws, and not test that the metadata is what is "expected".

When I've seen test failures that validated implementation details, the fix was always to change the expectations in the test, which to me means the test wasn't catching anything, it was just duplicating the code in a test.

@lzybkr lzybkr merged commit 177c99d into PowerShell:master Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.