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

Fixes ambiguity of parameter sets in VSTeamUserEntitlement cmdlets #400

Merged
merged 3 commits into from
Jul 13, 2021

Conversation

SebastianSchuetze
Copy link
Collaborator

@SebastianSchuetze SebastianSchuetze commented Jun 26, 2021

- added tests for changed parameter
Copy link
Contributor

@smurawski smurawski left a comment

Choose a reason for hiding this comment

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

This change shouldn't break existing behavior unless someone was counting on the buggy parameter validation experience to throw.

This change should bring the actual behavior in line with the documented behavior.

Are there any docs that need to change with the parameter set change?

-Email '[email protected]' `
-Force

Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are three values that are being passed up to the API in each of these requests. The only thing the function does is determine if there's a new value to apply or just pass back the current value.

This test should assert that the submitted update object has the expected license type since that isn't changing per the update call.

Copy link
Collaborator Author

@SebastianSchuetze SebastianSchuetze Jul 13, 2021

Choose a reason for hiding this comment

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

@smurawski I really tried to understand what you are saying. But I don't get what I should test in your opinion. The licenses are asserted, arent't they?

the cdmdlet does not have return so I can't test the correct return values. I will go ahead with the bug fix, but maybe you could still comment on this and I can improve the test later.

$resource -eq 'userentitlements' -and
$version -eq $(_getApiVersion MemberEntitlementManagement)
}
}

It 'by id should update a user' {
It 'by id without license should update a user' {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is missing similar validations to by email without a license.

@SebastianSchuetze
Copy link
Collaborator Author

Thanks and good point. I gonna check the docs for this.

@SebastianSchuetze SebastianSchuetze merged commit 2215b64 into MethodsAndPractices:trunk Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ambiguity or bug in Update-VSTeamUserEntitlement
2 participants