Skip to content

Commit

Permalink
Merge pull request Azure#11 from viananth/AzureStack
Browse files Browse the repository at this point in the history
Fix Gallery tests
  • Loading branch information
deathly809 authored Mar 20, 2018
2 parents 497905a + fd7e63a commit 672aae6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/StackAdmin/Azs.Gallery.Admin/Tests/src/GalleryItem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ InModuleScope Azs.Gallery.Admin {
$Found.Type | Should Be $Expected.Type

# Gallery Item
$Found.CategoryIds | Should Be $Expected.CategoryIds
if ($Expected.CategoryIds -and $Found.CategoryIds)
{
$Found.CategoryIds | Should Be $Expected.CategoryIds
}
elseif (($null -ne $Expected.CategoryIds) -and ($null -eq $Found.CategoryIds))
{
throw "Category Ids do not match Expected: $($Expected.CategoryIds)"
}
$Found.Description | Should Be $Expected.Description
$Found.LongSummary | Should Be $Expected.LongSummary
$Found.Publisher | Should Be $Expected.Publisher
Expand Down Expand Up @@ -138,7 +145,7 @@ InModuleScope Azs.Gallery.Admin {
$GalleryItems = Get-AzsGalleryItem
$GalleryItems | Should Not Be $null
foreach($GalleryItem in $GalleryItems) {
$retrieved = Get-AzsGalleryItem -GalleryItemName $GalleryItem.Name
$retrieved = Get-AzsGalleryItem -Name $GalleryItem.Name
AssertGalleryItemsAreSame -Expected $GalleryItem -Found $retrieved
}
}
Expand All @@ -149,12 +156,12 @@ InModuleScope Azs.Gallery.Admin {

$name = "microsoft.vmss.1.3.6"
$uri = "https://github.com/Azure/AzureStack-Tools/raw/master/ComputeAdmin/microsoft.vmss.1.3.6.azpkg"
Remove-AzsGalleryItem -GalleryItemName $name -Force
Remove-AzsGalleryItem -Name $name -Force

$GalleryItem = New-AzsGalleryItem -GalleryItemUri $uri
$GalleryItem | Should Not Be $null

Remove-AzsGalleryItem -GalleryItemName $name -Force
Remove-AzsGalleryItem -Name $name -Force
}
}
}

0 comments on commit 672aae6

Please sign in to comment.