Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan committed Jan 28, 2025
1 parent ceaab78 commit 74f8004
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,24 @@ Describe 'Test Find-PSResource for MAR Repository' -tags 'CI' {
It "Should find resource given specific Name, Version null" {
$res = Find-PSResource -Name "Az.Accounts" -Repository "MAR"
$res.Name | Should -Be "Az.Accounts"
$res.Version | Should -Be "4.0.0"
$res.Version | Should -BeGreaterThan ([Version]"4.0.0")
}

It "Should find resource and its dependency given specific Name and Version" {
$res = Find-PSResource -Name "Az.Storage" -Version "8.0.0" -Repository "MAR"
$res.Dependencies.Length | Should -Be 1
$res.Dependencies[0].Name | Should -Be "Az.Accounts"
}

It "Should find resource with wildcard in Name" {
$res = Find-PSResource -Name "Az.App*" -Repository "MAR"
$res | Should -Not -BeNullOrEmpty
$res.Count | Should -BeGreaterThan 1
}

It "Should find all resource with wildcard in Name" {
$res = Find-PSResource -Name "*" -Repository "MAR"
$res | Should -Not -BeNullOrEmpty
$res.Count | Should -BeGreaterThan 1
}
}

0 comments on commit 74f8004

Please sign in to comment.