Tests/Get-OriAzBopExternalDependenciesParamBasedOnTags.tests.ps1
. $PSScriptRoot\..\Private\Get-OriAzBopExternalDependenciesParamBasedOnTags.ps1 Describe 'OriAzBopBoostrapOriPsgallery\Get-OriAzBopExternalDependenciesParamBasedOnTags' { Context 'Succesfull excution' { Mock -CommandName Write-Verbose -Verifiable it 'Should be succesfully processed' { $Tags = 'Huu', ` 'ExternalModuleDependencies_Psql_RequiredVersion-2.0.0', ` 'ExternalModuleDependencies_Psql_MaximumVersion-3.0.0', ` 'ExternalModuleDependencies_Psql_Version-1.0.0', ` 'ExternalModuleDependencies_Psql_Guid-218cb4b2-911a-46b1-b47c-d3504acd4627', ` 'ExternalModuleDependencies_Psql_AllowPrerelease-true', ` 'ExternalModuleDependencies_Psql_Prerelease-pre02' $InstallParam = Get-OriAzBopExternalDependenciesParamBasedOnTags ` -ModuleName 'Psql' ` -Tags $Tags $InstallParam.Name -eq "Psql" | Should -BeExactly $True $InstallParam.RequiredVersion -eq [Version]'2.0.0' | Should -BeExactly $True $InstallParam.MaximumVersion -eq [Version]'3.0.0' | Should -BeExactly $True $InstallParam.Version -eq [Version]'1.0.0' | Should -BeExactly $True $InstallParam.Guid -eq [guid]"218cb4b2-911a-46b1-b47c-d3504acd4627" | Should -BeExactly $True $InstallParam.AllowPrerelease -eq $True | Should -BeExactly $True $InstallParam.Prerelease -eq "pre02" | Should -BeExactly $True $InstallParam.Count -eq 7 | Should -BeExactly $True } Assert-MockCalled Write-Verbose -Times 1 -Exactly -ParameterFilter { $Message -eq "-- End of Get-OriAzBopExternalDependenciesParamBasedOnTags --" } Assert-VerifiableMock } Context 'Succesfull excution' { Mock -CommandName Write-Verbose -Verifiable it 'Should be succesfully processed when Tags are empty' { $InstallParam = Get-OriAzBopExternalDependenciesParamBasedOnTags ` -ModuleName 'Psql' ` -Tags @() $InstallParam.Name -eq "Psql" | Should -BeExactly $True $InstallParam.Count -eq 1 | Should -BeExactly $True } Assert-MockCalled Write-Verbose -Times 1 -Exactly -ParameterFilter { $Message -eq "-- End of Get-OriAzBopExternalDependenciesParamBasedOnTags --" } Assert-VerifiableMock } } |