From 493795924377a5d05bf0a2b9c40eb29fe41c06ed Mon Sep 17 00:00:00 2001 From: Akinwale Alagbe Date: Wed, 18 Oct 2023 15:26:53 -0700 Subject: [PATCH] Add all properties to tests --- .../ManifestUnitTest/V1ManifestReadTest.cs | 19 +++++++++++++++++++ .../TestCollateral/V1_6ManifestMerged.yaml | 16 ++++++++++++++-- .../Manifest/V1/ManifestInstaller.cs | 6 ------ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs b/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs index efaef50666..c33e654ada 100644 --- a/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs +++ b/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs @@ -355,6 +355,25 @@ private void ValidateManifestFields(Manifest manifest, TestManifestVersion manif Assert.Single(manifest.UnsupportedOSArchitectures); Assert.Equal("arm", manifest.UnsupportedOSArchitectures[0]); + + Assert.Single(installer1.InstallationMetadata.Files); + ManifestInstallerFile installerFile2 = installer1.InstallationMetadata.Files[0]; + Assert.Equal("main2.exe", installerFile2.RelativeFilePath); + Assert.Equal("DisplayName2", installerFile2.DisplayName); + Assert.Equal("/arg2", installerFile2.InvocationParameter); + Assert.Equal("79D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82", installerFile2.FileSha256); + + Assert.Equal("msi", installer1.NestedInstallerType); + + InstallerNestedInstallerFile installerNestedInstallerFile2 = installer1.NestedInstallerFiles[0]; + Assert.Equal("RelativeFilePath2", installerNestedInstallerFile2.RelativeFilePath); + Assert.Equal("PortableCommandAlias2", installerNestedInstallerFile2.PortableCommandAlias); + + Assert.Single(installer1.UnsupportedArguments); + Assert.Equal("location", installer1.UnsupportedArguments[0]); + + Assert.True(installer1.DisplayInstallWarnings); + Assert.True(installer1.DownloadCommandProhibited); } } diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml index dda831944c..2a1feeb9aa 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml @@ -199,9 +199,13 @@ Installers: ReleaseDate: 2021-02-02 InstallerAbortsTerminal: false InstallLocationRequired: false + NestedInstallerFiles: + - RelativeFilePath: RelativeFilePath2 + PortableCommandAlias: PortableCommandAlias2 RequireExplicitUpgrade: false - DisplayInstallWarnings: false + DisplayInstallWarnings: true ElevationRequirement: elevationRequired + NestedInstallerType: msi UnsupportedArguments: - location UnsupportedOSArchitectures: @@ -212,7 +216,15 @@ Installers: ExpectedReturnCodes: - InstallerReturnCode: 2 ReturnResponse: contactSupport - DownloadCommandProhibited: false + DownloadCommandProhibited: true + InstallationMetadata: + DefaultInstallLocation: "%ProgramFiles%\\TestApp" + Files: + - RelativeFilePath: "main2.exe" + FileSha256: 79D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + FileType: launch2 + InvocationParameter: "/arg2" + DisplayName: "DisplayName2" - Architecture: x64 InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe diff --git a/src/WinGetUtilInterop/Manifest/V1/ManifestInstaller.cs b/src/WinGetUtilInterop/Manifest/V1/ManifestInstaller.cs index 7c5536a9c5..b390e04731 100644 --- a/src/WinGetUtilInterop/Manifest/V1/ManifestInstaller.cs +++ b/src/WinGetUtilInterop/Manifest/V1/ManifestInstaller.cs @@ -184,11 +184,6 @@ public class ManifestInstaller /// public List NestedInstallerFiles { get; set; } - /// - /// Gets or sets the excluded markets. - /// - public string ExcludedMarkets { get; set; } - /// /// Gets or sets the unsupported arguments. /// @@ -265,7 +260,6 @@ public bool Equals(ManifestInstaller other) (this.InstallationMetadata == other.InstallationMetadata) && (this.NestedInstallerType == other.NestedInstallerType) && (this.NestedInstallerFiles == other.NestedInstallerFiles) && - (this.ExcludedMarkets == other.ExcludedMarkets) && (this.DisplayInstallWarnings == other.DisplayInstallWarnings); }