Skip to content

Commit 6e39ab9

Browse files
committed
Add test with short version
1 parent 9ca8087 commit 6e39ab9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/PowerShell/tests/Microsoft.WinGet.Client.Tests.ps1

+15
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,21 @@ Describe 'Export-WinGetPackage' {
600600
Test-Path -Path $testDirectory | Should -Be $false
601601
}
602602

603+
It 'Download with short Version' {
604+
$testDirectory = GetRandomTestDirectory
605+
$result = Export-WinGetPackage -Id AppInstallerTest.TestExeInstaller -Version '1' -DownloadDirectory $testDirectory
606+
607+
$result | Should -Not -BeNullOrEmpty
608+
$result.Id | Should -Be "AppInstallerTest.TestExeInstaller"
609+
$result.Name | Should -Be "TestExeInstaller"
610+
$result.Source | Should -Be "TestSource"
611+
$result.Status | Should -Be 'Ok'
612+
613+
# Download directory should be created and have exactly two files (installer and manifest file).
614+
Test-Path -Path $testDirectory | Should -Be $true
615+
(Get-ChildItem -Path $testDirectory -Force | Measure-Object).Count | Should -Be 2
616+
}
617+
603618
AfterEach {
604619
if (Test-Path $testDirectory) {
605620
Remove-Item $testDirectory -Force -Recurse

0 commit comments

Comments
 (0)