@@ -40,6 +40,17 @@ Describe "VSTeamUserEntitlement" -Tag 'VSTeamUserEntitlement' {
4040 }
4141 }
4242
43+ It ' by Id should return users with projects' {
44+ $user = Get-VSTeamUserEntitlement - Id ' 00000000-0000-0000-0000-000000000000'
45+
46+ $user.Email | Should - Be ' test@test.com' - Because ' email is from type'
47+ $user.userName | Should - Be ' Donovan Brown' - Because ' userName is from type'
48+
49+ Should - Invoke Invoke-RestMethod - Exactly - Times 1 - Scope It - ParameterFilter {
50+ $Uri -eq " https://vsaex.dev.azure.com/test/_apis/userentitlements/00000000-0000-0000-0000-000000000000?api-version=$ ( _getApiVersion MemberEntitlementManagement) "
51+ }
52+ }
53+
4354 Context ' Get-VSTeamUserEntitlement up to version 6.0' {
4455 BeforeAll {
4556 Mock _getApiVersion { return ' 1.0-unitTests' } - ParameterFilter { $Service -eq ' MemberEntitlementManagement' }
@@ -57,17 +68,6 @@ Describe "VSTeamUserEntitlement" -Tag 'VSTeamUserEntitlement' {
5768 }
5869 }
5970
60- It ' by Id should return users with projects' {
61- $user = Get-VSTeamUserEntitlement - Id ' 00000000-0000-0000-0000-000000000000'
62-
63- $user.Email | Should - Be ' test@test.com' - Because ' email is from type'
64- $user.userName | Should - Be ' Donovan Brown' - Because ' userName is from type'
65-
66- Should - Invoke Invoke-RestMethod - Exactly - Times 1 - Scope It - ParameterFilter {
67- $Uri -eq " https://vsaex.dev.azure.com/test/_apis/userentitlements/00000000-0000-0000-0000-000000000000?api-version=$ ( _getApiVersion MemberEntitlementManagement) "
68- }
69- }
70-
7171 It ' with select for projects should return users with projects' {
7272 Get-VSTeamUserEntitlement - Select Projects
7373
@@ -93,10 +93,6 @@ Describe "VSTeamUserEntitlement" -Tag 'VSTeamUserEntitlement' {
9393 }
9494 }
9595
96- It ' should throw by ID and version 6.0 onwards' {
97- { Get-VSTeamUserEntitlement - Id ' 00000000-0000-0000-0000-000000000000' } | Should - Throw
98- }
99-
10096 It " with incorrect case in license parameter should throw" {
10197 { Get-VSTeamUserEntitlement - License account- Advanced} | Should - Throw
10298 }
0 commit comments