Skip to content

Commit

Permalink
Added more test asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
Akinwale Alagbe committed Oct 18, 2023
1 parent 695dbaa commit 5879735
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,13 @@ private void ValidateManifestFields(Manifest manifest, TestManifestVersion manif
if (manifestVersion >= TestManifestVersion.V160)
{
Assert.Equal("msi", manifest.NestedInstallerType);
Assert.Single(manifest.NestedInstallerFiles);
Assert.Equal("Default installation notes", manifest.InstallationNotes);
Assert.Equal("https://DefaultPurchaseUrl.com", manifest.PurchaseUrl);

Assert.True(manifest.DisplayInstallWarnings);
Assert.True(manifest.DownloadCommandProhibited);

Assert.Single(manifest.NestedInstallerFiles);
InstallerNestedInstallerFile installerNestedInstallerFile = manifest.NestedInstallerFiles[0];
Assert.Equal("RelativeFilePath", installerNestedInstallerFile.RelativeFilePath);
Assert.Equal("PortableCommandAlias", installerNestedInstallerFile.PortableCommandAlias);
Expand All @@ -329,6 +334,27 @@ private void ValidateManifestFields(Manifest manifest, TestManifestVersion manif
Assert.Equal("DisplayName", installerFile.DisplayName);
Assert.Equal("/arg", installerFile.InvocationParameter);
Assert.Equal("69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82", installerFile.FileSha256);

Assert.Single(manifest.Documentations);
ManifestDocumentation manifestDocumentation = manifest.Documentations[0];

Assert.Equal("Default document label", manifestDocumentation.DocumentLabel);
Assert.Equal("https://DefaultDocumentUrl.com", manifestDocumentation.DocumentUrl);

Assert.Single(manifest.Icons);
ManifestIcon icon = manifest.Icons[0];

Assert.Equal("69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123", icon.IconSha256);
Assert.Equal("default", icon.IconTheme);
Assert.Equal("https://testIcon", icon.IconUrl);
Assert.Equal("custom", icon.IconResolution);
Assert.Equal("ico", icon.IconFileType);

Assert.Single(manifest.UnsupportedArguments);
Assert.Equal("log", manifest.UnsupportedArguments[0]);

Assert.Single(manifest.UnsupportedOSArchitectures);
Assert.Equal("arm", manifest.UnsupportedOSArchitectures[0]);
}
}

Expand Down
11 changes: 3 additions & 8 deletions src/WinGetUtilInterop/Manifest/V1/Manifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public class Manifest
/// <summary>
/// Gets or sets the manifest documentation.
/// </summary>
public ManifestDocumentation Documentation { get; set; }
public List<ManifestDocumentation> Documentations { get; set; }

/// <summary>
/// Gets or sets the manifest icon information.
/// Gets or sets the manifest icons information.
/// </summary>
public ManifestIcon Icon { get; set; }
public List<ManifestIcon> Icons { get; set; }

/// <summary>
/// Gets or sets the release notes url in default locale.
Expand Down Expand Up @@ -272,11 +272,6 @@ public class Manifest
/// </summary>
public List<InstallerNestedInstallerFile> NestedInstallerFiles { get; set; }

/// <summary>
/// Gets or sets the excluded markets.
/// </summary>
public string ExcludedMarkets { get; set; }

/// <summary>
/// Gets or sets the unsupported arguments.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/WinGetUtilInterop/Manifest/V1/ManifestIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public class ManifestIcon
/// <summary>
/// Gets or sets the icon sha256.
/// </summary>
public string IconSha56 { get; set; }
public string IconSha256 { get; set; }
}
}

0 comments on commit 5879735

Please sign in to comment.