1616 $repo = New-GitHubRepository - RepositoryName ([Guid ]::NewGuid().Guid) - AutoInit
1717
1818 Context ' When initially created, there are no issues' {
19- $issues = Get-GitHubIssue - Uri $repo.svn_url
19+ $issues = @ ( Get-GitHubIssue - Uri $repo.svn_url )
2020
2121 It ' Should return expected number of issues' {
22- @ ( $issues ) .Count | Should be 0
22+ $issues.Count | Should be 0
2323 }
2424 }
2525
3434 $newIssues [0 ] = Update-GitHubIssue - OwnerName $script :ownerName - RepositoryName $repo.name - Issue $newIssues [0 ].number - State Closed
3535 $newIssues [-1 ] = Update-GitHubIssue - OwnerName $script :ownerName - RepositoryName $repo.name - Issue $newIssues [-1 ].number - State Closed
3636
37- $issues = Get-GitHubIssue - Uri $repo.svn_url
37+ $issues = @ ( Get-GitHubIssue - Uri $repo.svn_url )
3838 It ' Should return only open issues' {
39- @ ( $issues ) .Count | Should be 2
39+ $issues.Count | Should be 2
4040 }
4141
42- $issues = Get-GitHubIssue - Uri $repo.svn_url - State All
42+ $issues = @ ( Get-GitHubIssue - Uri $repo.svn_url - State All)
4343 It ' Should return all issues' {
44- @ ( $issues ) .Count | Should be 4
44+ $issues.Count | Should be 4
4545 }
4646
4747 $createdOnOrAfterDate = Get-Date - Date $newIssues [0 ].created_at
4848 $createdOnOrBeforeDate = Get-Date - Date $newIssues [2 ].created_at
49- $issues = ( Get-GitHubIssue - Uri $repo.svn_url ) | Where-Object { ($_.created_at -ge $createdOnOrAfterDate ) -and ($_.created_at -le $createdOnOrBeforeDate ) }
49+ $issues = @ (( Get-GitHubIssue - Uri $repo.svn_url ) | Where-Object { ($_.created_at -ge $createdOnOrAfterDate ) -and ($_.created_at -le $createdOnOrBeforeDate ) })
5050
5151 It ' Smart object date conversion works for comparing dates' {
52- @ ( $issues ) .Count | Should be 2
52+ $issues.Count | Should be 2
5353 }
5454
5555 $createdDate = Get-Date - Date $newIssues [1 ].created_at
56- $issues = Get-GitHubIssue - Uri $repo.svn_url - State All | Where-Object { ($_.created_at -ge $createdDate ) -and ($_.state -eq ' closed' ) }
56+ $issues = @ ( Get-GitHubIssue - Uri $repo.svn_url - State All | Where-Object { ($_.created_at -ge $createdDate ) -and ($_.state -eq ' closed' ) })
5757
5858 It ' Able to filter based on date and state' {
59- @ ( $issues ) .Count | Should be 1
59+ $issues.Count | Should be 1
6060 }
6161 }
6262
8888 $issueCounts = $issueCounts | Sort-Object - Property Count - Descending
8989
9090 It ' Should return expected number of issues for each repository' {
91- @ ( $issueCounts [0 ].Count) | Should be 3
92- @ ( $issueCounts [1 ].Count) | Should be 0
91+ $issueCounts [0 ].Count | Should be 3
92+ $issueCounts [1 ].Count | Should be 0
9393 }
9494
9595 It ' Should return expected repository names' {
96- @ ( $issueCounts [0 ].Uri) | Should be ( $repo1.svn_url )
97- @ ( $issueCounts [1 ].Uri) | Should be ( $repo2.svn_url )
96+ $issueCounts [0 ].Uri | Should be $repo1.svn_url
97+ $issueCounts [1 ].Uri | Should be $repo2.svn_url
9898 }
9999 }
100100
101- $null = Remove-GitHubRepository - Uri ( $repo1.svn_url )
102- $null = Remove-GitHubRepository - Uri ( $repo2.svn_url )
101+ $null = Remove-GitHubRepository - Uri $repo1.svn_url
102+ $null = Remove-GitHubRepository - Uri $repo2.svn_url
103103 }
104104
105105
@@ -186,10 +186,10 @@ try
186186 $null = New-GitHubRepository - RepositoryName $repositoryName - AutoInit
187187 $repositoryUrl = " https://github.com/$script :ownerName /$repositoryName "
188188
189- $collaborators = Get-GitHubRepositoryCollaborator - Uri $repositoryUrl
189+ $collaborators = @ ( Get-GitHubRepositoryCollaborator - Uri $repositoryUrl )
190190
191191 It ' Should return expected number of collaborators' {
192- @ ( $collaborators ) .Count | Should be 1
192+ $collaborators.Count | Should be 1
193193 }
194194
195195 $null = Remove-GitHubRepository - OwnerName $script :ownerName - RepositoryName $repositoryName
@@ -201,10 +201,10 @@ try
201201 $null = New-GitHubRepository - RepositoryName $repositoryName - AutoInit
202202 $repositoryUrl = " https://github.com/$script :ownerName /$repositoryName "
203203
204- $contributors = Get-GitHubRepositoryContributor - Uri $repositoryUrl - IncludeStatistics
204+ $contributors = @ ( Get-GitHubRepositoryContributor - Uri $repositoryUrl - IncludeStatistics)
205205
206206 It ' Should return expected number of contributors' {
207- @ ( $contributors ) .Count | Should be 1
207+ $contributors.Count | Should be 1
208208 }
209209
210210 $null = Remove-GitHubRepository - OwnerName $script :ownerName - RepositoryName $repositoryName
@@ -242,15 +242,13 @@ try
242242 }
243243
244244 Describe ' Getting repositories from organization' {
245- <# Temporary hack due to issues with this test in ADO #> . (Join-Path - Path $moduleRootPath - ChildPath ' Tests\Config\Settings.ps1' )
246-
247- $original = Get-GitHubRepository - OrganizationName $script :organizationName
245+ $original = @ (Get-GitHubRepository - OrganizationName $script :organizationName )
248246
249247 $repo = New-GitHubRepository - RepositoryName ([guid ]::NewGuid().Guid) - OrganizationName $script :organizationName
250- $current = Get-GitHubRepository - OrganizationName $script :organizationName
248+ $current = @ ( Get-GitHubRepository - OrganizationName $script :organizationName )
251249
252250 It ' Should return expected number of organization repositories' {
253- (@ ( $current ) .Count - @ ( $original ) .Count) | Should be 1
251+ ($current.Count - $original.Count ) | Should be 1
254252 }
255253
256254 $null = Remove-GitHubRepository - Uri $repo.svn_url
@@ -260,15 +258,15 @@ try
260258 $repositoryName = [guid ]::NewGuid().Guid
261259 $null = New-GitHubRepository - RepositoryName $repositoryName - AutoInit
262260
263- $contributors = Get-GitHubRepositoryContributor - OwnerName $script :ownerName - RepositoryName $repositoryName - IncludeStatistics
261+ $contributors = @ ( Get-GitHubRepositoryContributor - OwnerName $script :ownerName - RepositoryName $repositoryName - IncludeStatistics)
264262
265263 $uniqueContributors = $contributors |
266264 Select-Object - ExpandProperty author |
267265 Select-Object - ExpandProperty login - Unique
268266 Sort-Object
269267
270268 It ' Should return expected number of unique contributors' {
271- @ ( $uniqueContributors ) .Count | Should be 1
269+ $uniqueContributors.Count | Should be 1
272270 }
273271
274272 $null = Remove-GitHubRepository - OwnerName $script :ownerName - RepositoryName $repositoryName
@@ -298,14 +296,14 @@ try
298296 $repositoryName = [guid ]::NewGuid().Guid
299297 $null = New-GitHubRepository - RepositoryName $repositoryName - AutoInit
300298
301- $branches = Get-GitHubRepositoryBranch - OwnerName $script :ownerName - RepositoryName $repositoryName
299+ $branches = @ ( Get-GitHubRepositoryBranch - OwnerName $script :ownerName - RepositoryName $repositoryName )
302300
303301 It ' Should return expected number of repository branches' {
304- @ ( $branches ) .Count | Should be 1
302+ $branches.Count | Should be 1
305303 }
306304
307305 It ' Should return the name of the branches' {
308- @ ( $branches [0 ].name) | Should be " master"
306+ $branches [0 ].name | Should be ' master'
309307 }
310308
311309 $null = Remove-GitHubRepository - OwnerName $script :ownerName - RepositoryName $repositoryName
0 commit comments