Skip to content

Commit

Permalink
Add member tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardWolosky committed Aug 12, 2020
1 parent 8b3e3b0 commit d6d575e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Tests/GitHubTeams.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,54 @@ try
}
}
}

Describe 'GitHubTeams\Get-GitHubTeamMember' {
BeforeAll {
$organizationName = $script:organizationName
$teamName = [Guid]::NewGuid().Guid
$team = New-GitHubTeam -OrganizationName $organizationName -TeamName $teamName
}

AfterAll {
$team | Remove-GitHubTeam -Force
}

Context 'Getting team members using TeamName' {
$members = @(Get-GitHubTeamMember -OrganizationName $organizationName -TeamName $teamName)

It 'Should have the expected type number of members' {
$members.Count | Should -Be 1
}

It 'Should have the expected type and additional properties' {
$members[0].PSObject.TypeNames[0] | Should -Be 'GitHub.User'
}
}

Context 'Getting team members using TeamSlug' {
$members = @(Get-GitHubTeamMember -OrganizationName $organizationName -TeamSlug $team.slug)

It 'Should have the expected type number of members' {
$members.Count | Should -Be 1
}

It 'Should have the expected type and additional properties' {
$members[0].PSObject.TypeNames[0] | Should -Be 'GitHub.User'
}
}

Context 'Getting team members using TeamSlug on the pipeline' {
$members = @($team | Get-GitHubTeamMember)

It 'Should have the expected type number of members' {
$members.Count | Should -Be 1
}

It 'Should have the expected type and additional properties' {
$members[0].PSObject.TypeNames[0] | Should -Be 'GitHub.User'
}
}
}
}
finally
{
Expand Down

0 comments on commit d6d575e

Please sign in to comment.