Skip to content

Commit d3bc026

Browse files
committed
Added pester test as per review feedback
1 parent be437d3 commit d3bc026

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/Groups/v1.0/test/New-MgGroup.Tests.ps1

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,29 @@ Describe 'New-MgGroup' {
2525
Context 'Create' {
2626
It 'ShouldCreateNewGroup' {
2727
$CreateGroups = @()
28-
1..100 | ForEach-Object {
28+
1..10 | ForEach-Object {
2929
$Mock.PushScenario('ShouldCreateNewGroup')
3030
$CreateGroups += New-MgGroup -DisplayName "new-mggroup-test" -MailEnabled:$false -MailNickname 'unused' -SecurityEnabled
3131
}
3232

33-
$CreateGroups | Should -HaveCount 100
33+
$CreateGroups | Should -HaveCount 10
3434
$CreateGroups[0].DisplayName | Should -Be "new-mggroup-test"
3535
$CreateGroups[0].MailEnabled | Should -BeFalse
3636
}
37+
38+
It 'ShouldHaveASingleResponseObjectIfRHVIsPassed' {
39+
$Mock.PushScenario('ShouldCreateNewGroup')
40+
$group = New-MgGroup -DisplayName "new-mggroup-test" -MailEnabled:$false -MailNickname 'unused' -SecurityEnabled -RHV rh
41+
$group.Count | Should -HaveCount 1
42+
}
43+
44+
It 'ShouldAssignRetrieveHeadersToRHVIfPassed' {
45+
$Mock.PushScenario('ShouldCreateNewGroup')
46+
New-MgGroup -DisplayName "new-mggroup-test" -MailEnabled:$false -MailNickname 'unused' -SecurityEnabled -RHV rv
47+
$rv.Vary | Should -Be "Accept-Encoding"
48+
$rv.'Content-Type' | Should -Be "application/json"
49+
50+
51+
}
3752
}
3853
}

0 commit comments

Comments
 (0)