@@ -247,6 +247,83 @@ namespace
247247 })delimiter" );
248248 }
249249
250+ void VerifyLocalizations_AllFields (const AppInstaller::Manifest::Manifest& manifest)
251+ {
252+ REQUIRE (manifest.DefaultLocalization .Locale == " en-US" );
253+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Publisher>() == " Foo" );
254+ REQUIRE (manifest.DefaultLocalization .Get <Localization::PublisherUrl>() == " http://publisher.net" );
255+ REQUIRE (manifest.DefaultLocalization .Get <Localization::PublisherSupportUrl>() == " http://publisherSupport.net" );
256+ REQUIRE (manifest.DefaultLocalization .Get <Localization::PrivacyUrl>() == " http://packagePrivacyUrl.net" );
257+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Author>() == " FooBar" );
258+ REQUIRE (manifest.DefaultLocalization .Get <Localization::PackageName>() == " Bar" );
259+ REQUIRE (manifest.DefaultLocalization .Get <Localization::PackageUrl>() == " http://packageUrl.net" );
260+ REQUIRE (manifest.DefaultLocalization .Get <Localization::License>() == " Foo Bar License" );
261+ REQUIRE (manifest.DefaultLocalization .Get <Localization::LicenseUrl>() == " http://licenseUrl.net" );
262+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Copyright>() == " Foo Bar Copyright" );
263+ REQUIRE (manifest.DefaultLocalization .Get <Localization::CopyrightUrl>() == " http://copyrightUrl.net" );
264+ REQUIRE (manifest.DefaultLocalization .Get <Localization::ShortDescription>() == " Foo bar is a foo bar." );
265+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Description>() == " Foo bar is a placeholder." );
266+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Tags>().size () == 3 );
267+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Tags>().at (0 ) == " FooBar" );
268+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Tags>().at (1 ) == " Foo" );
269+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Tags>().at (2 ) == " Bar" );
270+ REQUIRE (manifest.DefaultLocalization .Get <Localization::ReleaseNotes>() == " Default release notes" );
271+ REQUIRE (manifest.DefaultLocalization .Get <Localization::ReleaseNotesUrl>() == " https://DefaultReleaseNotes.net" );
272+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Agreements>().size () == 1 );
273+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Agreements>().at (0 ).Label == " DefaultLabel" );
274+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Agreements>().at (0 ).AgreementText == " DefaultText" );
275+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Agreements>().at (0 ).AgreementUrl == " https://DefaultAgreementUrl.net" );
276+ REQUIRE (manifest.DefaultLocalization .Get <Localization::PurchaseUrl>() == " http://DefaultPurchaseUrl.net" );
277+ REQUIRE (manifest.DefaultLocalization .Get <Localization::InstallationNotes>() == " Default Installation Notes" );
278+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Documentations>().size () == 1 );
279+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Documentations>().at (0 ).DocumentLabel == " Default Document Label" );
280+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Documentations>().at (0 ).DocumentUrl == " http://DefaultDocumentUrl.net" );
281+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Icons>().size () == 1 );
282+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Icons>().at (0 ).Url == " https://DefaultTestIcon" );
283+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Icons>().at (0 ).FileType == IconFileTypeEnum::Ico);
284+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Icons>().at (0 ).Resolution == IconResolutionEnum::Custom);
285+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Icons>().at (0 ).Theme == IconThemeEnum::Default);
286+ REQUIRE (manifest.DefaultLocalization .Get <Localization::Icons>().at (0 ).Sha256 == AppInstaller::Utility::SHA256::ConvertToBytes (" 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123" ));
287+
288+ REQUIRE (manifest.Localizations .size () == 1 );
289+ ManifestLocalization frenchLocalization = manifest.Localizations .at (0 );
290+ REQUIRE (frenchLocalization.Locale == " fr-Fr" );
291+ REQUIRE (frenchLocalization.Get <Localization::Publisher>() == " Foo French" );
292+ REQUIRE (frenchLocalization.Get <Localization::PublisherUrl>() == " http://publisher-fr.net" );
293+ REQUIRE (frenchLocalization.Get <Localization::PublisherSupportUrl>() == " http://publisherSupport-fr.net" );
294+ REQUIRE (frenchLocalization.Get <Localization::PrivacyUrl>() == " http://packagePrivacyUrl-fr.net" );
295+ REQUIRE (frenchLocalization.Get <Localization::Author>() == " FooBar French" );
296+ REQUIRE (frenchLocalization.Get <Localization::PackageName>() == " Bar" );
297+ REQUIRE (frenchLocalization.Get <Localization::PackageUrl>() == " http://packageUrl-fr.net" );
298+ REQUIRE (frenchLocalization.Get <Localization::License>() == " Foo Bar License" );
299+ REQUIRE (frenchLocalization.Get <Localization::LicenseUrl>() == " http://licenseUrl-fr.net" );
300+ REQUIRE (frenchLocalization.Get <Localization::Copyright>() == " Foo Bar Copyright" );
301+ REQUIRE (frenchLocalization.Get <Localization::CopyrightUrl>() == " http://copyrightUrl-fr.net" );
302+ REQUIRE (frenchLocalization.Get <Localization::ShortDescription>() == " Foo bar is a foo bar French." );
303+ REQUIRE (frenchLocalization.Get <Localization::Description>() == " Foo bar is a placeholder French." );
304+ REQUIRE (frenchLocalization.Get <Localization::Tags>().size () == 3 );
305+ REQUIRE (frenchLocalization.Get <Localization::Tags>().at (0 ) == " FooBarFr" );
306+ REQUIRE (frenchLocalization.Get <Localization::Tags>().at (1 ) == " FooFr" );
307+ REQUIRE (frenchLocalization.Get <Localization::Tags>().at (2 ) == " BarFr" );
308+ REQUIRE (frenchLocalization.Get <Localization::ReleaseNotes>() == " Release notes" );
309+ REQUIRE (frenchLocalization.Get <Localization::ReleaseNotesUrl>() == " https://ReleaseNotes.net" );
310+ REQUIRE (frenchLocalization.Get <Localization::Agreements>().size () == 1 );
311+ REQUIRE (frenchLocalization.Get <Localization::Agreements>().at (0 ).Label == " Label" );
312+ REQUIRE (frenchLocalization.Get <Localization::Agreements>().at (0 ).AgreementText == " Text" );
313+ REQUIRE (frenchLocalization.Get <Localization::Agreements>().at (0 ).AgreementUrl == " https://AgreementUrl.net" );
314+ REQUIRE (frenchLocalization.Get <Localization::PurchaseUrl>() == " http://purchaseUrl.net" );
315+ REQUIRE (frenchLocalization.Get <Localization::InstallationNotes>() == " Installation Notes" );
316+ REQUIRE (frenchLocalization.Get <Localization::Documentations>().size () == 1 );
317+ REQUIRE (frenchLocalization.Get <Localization::Documentations>().at (0 ).DocumentLabel == " Document Label" );
318+ REQUIRE (frenchLocalization.Get <Localization::Documentations>().at (0 ).DocumentUrl == " http://documentUrl.net" );
319+ REQUIRE (frenchLocalization.Get <Localization::Icons>().size () == 1 );
320+ REQUIRE (frenchLocalization.Get <Localization::Icons>().at (0 ).Url == " https://testIcon" );
321+ REQUIRE (frenchLocalization.Get <Localization::Icons>().at (0 ).FileType == IconFileTypeEnum::Png);
322+ REQUIRE (frenchLocalization.Get <Localization::Icons>().at (0 ).Resolution == IconResolutionEnum::Square32);
323+ REQUIRE (frenchLocalization.Get <Localization::Icons>().at (0 ).Theme == IconThemeEnum::Light);
324+ REQUIRE (frenchLocalization.Get <Localization::Icons>().at (0 ).Sha256 == AppInstaller::Utility::SHA256::ConvertToBytes (" 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321" ));
325+ }
326+
250327 void VerifyInstallers_AllFields (const AppInstaller::Manifest::Manifest& manifest)
251328 {
252329 REQUIRE (manifest.Installers .size () == 1 );
@@ -261,6 +338,68 @@ namespace
261338 REQUIRE (actualInstaller.MinOSVersion == " 1078" );
262339 REQUIRE (actualInstaller.BaseInstallerType == InstallerTypeEnum::Zip);
263340 REQUIRE (actualInstaller.Scope == ScopeEnum::User);
341+ REQUIRE (actualInstaller.InstallModes .size () == 1 );
342+ REQUIRE (actualInstaller.InstallModes .at (0 ) == InstallModeEnum::Interactive);
343+ REQUIRE (actualInstaller.Switches .size () == 8 );
344+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::Silent) == " /s" );
345+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::SilentWithProgress) == " /s" );
346+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::Interactive) == " /i" );
347+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::InstallLocation) == " C:\\ Users\\ User1" );
348+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::Log) == " /l" );
349+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::Update) == " /u" );
350+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::Custom) == " /custom" );
351+ REQUIRE (actualInstaller.Switches .at (InstallerSwitchType::Repair) == " /repair" );
352+ REQUIRE (actualInstaller.InstallerSuccessCodes .size () == 1 );
353+ REQUIRE (actualInstaller.InstallerSuccessCodes .at (0 ) == 0 );
354+ REQUIRE (actualInstaller.UpdateBehavior == UpdateBehaviorEnum::Deny);
355+ REQUIRE (actualInstaller.Commands .at (0 ) == " command1" );
356+ REQUIRE (actualInstaller.Protocols .at (0 ) == " protocol1" );
357+ REQUIRE (actualInstaller.FileExtensions .at (0 ) == " .file-extension" );
358+ REQUIRE (actualInstaller.Dependencies .HasExactDependency (DependencyType::WindowsFeature, " feature1" ));
359+ REQUIRE (actualInstaller.Dependencies .HasExactDependency (DependencyType::WindowsLibrary, " library1" ));
360+ REQUIRE (actualInstaller.Dependencies .HasExactDependency (DependencyType::Package, " Foo.Baz" , " 2.0.0" ));
361+ REQUIRE (actualInstaller.Dependencies .HasExactDependency (DependencyType::External, " FooBarBaz" ));
362+ REQUIRE (actualInstaller.PackageFamilyName == " " );
363+ REQUIRE (actualInstaller.ProductCode == " 5b6e0f8a-3bbf-4a17-aefd-024c2b3e075d" );
364+ REQUIRE (actualInstaller.ReleaseDate == " 2021-01-01" );
365+ REQUIRE (actualInstaller.InstallerAbortsTerminal );
366+ REQUIRE (actualInstaller.InstallLocationRequired );
367+ REQUIRE (actualInstaller.RequireExplicitUpgrade );
368+ REQUIRE (actualInstaller.ElevationRequirement == ElevationRequirementEnum::ElevatesSelf);
369+ REQUIRE (actualInstaller.UnsupportedOSArchitectures .size () == 1 );
370+ REQUIRE (actualInstaller.UnsupportedOSArchitectures .at (0 ) == Architecture::Arm);
371+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .size () == 1 );
372+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .at (0 ).DisplayName == " DisplayName" );
373+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .at (0 ).DisplayVersion == " DisplayVersion" );
374+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .at (0 ).Publisher == " Publisher" );
375+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .at (0 ).ProductCode == " ProductCode" );
376+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .at (0 ).UpgradeCode == " UpgradeCode" );
377+ REQUIRE (actualInstaller.AppsAndFeaturesEntries .at (0 ).InstallerType == InstallerTypeEnum::Exe);
378+ REQUIRE (actualInstaller.Markets .AllowedMarkets .size () == 1 );
379+ REQUIRE (actualInstaller.Markets .AllowedMarkets .at (0 ) == " US" );
380+ REQUIRE (actualInstaller.ExpectedReturnCodes .at (3 ).ReturnResponseEnum == ExpectedReturnCodeEnum::Custom);
381+ REQUIRE (actualInstaller.ExpectedReturnCodes .at (3 ).ReturnResponseUrl == " http://returnResponseUrl.net" );
382+ REQUIRE (actualInstaller.NestedInstallerType == InstallerTypeEnum::Portable);
383+ REQUIRE (actualInstaller.DisplayInstallWarnings );
384+ REQUIRE (actualInstaller.UnsupportedArguments .size () == 1 );
385+ REQUIRE (actualInstaller.UnsupportedArguments .at (0 ) == UnsupportedArgumentEnum::Log);
386+ REQUIRE (actualInstaller.NestedInstallerFiles .size () == 1 );
387+ REQUIRE (actualInstaller.NestedInstallerFiles .at (0 ).RelativeFilePath == " test\\ app.exe" );
388+ REQUIRE (actualInstaller.NestedInstallerFiles .at (0 ).PortableCommandAlias == " test.exe" );
389+ REQUIRE (actualInstaller.InstallationMetadata .DefaultInstallLocation == " %TEMP%\\ DefaultInstallLocation" );
390+ REQUIRE (actualInstaller.InstallationMetadata .Files .size () == 1 );
391+ REQUIRE (actualInstaller.InstallationMetadata .Files .at (0 ).RelativeFilePath == " test\\ app.exe" );
392+ REQUIRE (actualInstaller.InstallationMetadata .Files .at (0 ).FileType == InstalledFileTypeEnum::Launch);
393+ REQUIRE (actualInstaller.InstallationMetadata .Files .at (0 ).FileSha256 == AppInstaller::Utility::SHA256::ConvertToBytes (" 011048877dfaef109801b3f3ab2b60afc74f3fc4f7b3430e0c897f5da1df84b6" ));
394+ REQUIRE (actualInstaller.InstallationMetadata .Files .at (0 ).InvocationParameter == " /parameter" );
395+ REQUIRE (actualInstaller.InstallationMetadata .Files .at (0 ).DisplayName == " test" );
396+ REQUIRE (actualInstaller.DownloadCommandProhibited );
397+ REQUIRE (actualInstaller.RepairBehavior == RepairBehaviorEnum::Uninstaller);
398+ REQUIRE (actualInstaller.ArchiveBinariesDependOnPath );
399+ REQUIRE (actualInstaller.AuthInfo .Type == AppInstaller::Authentication::AuthenticationType::MicrosoftEntraId);
400+ REQUIRE (actualInstaller.AuthInfo .MicrosoftEntraIdInfo .has_value ());
401+ REQUIRE (actualInstaller.AuthInfo .MicrosoftEntraIdInfo ->Resource == " TestResource" );
402+ REQUIRE (actualInstaller.AuthInfo .MicrosoftEntraIdInfo ->Scope == " TestScope" );
264403
265404 // DesiredStateConfiguration
266405 REQUIRE (actualInstaller.DesiredStateConfiguration .size () == 2 );
@@ -296,5 +435,6 @@ TEST_CASE("GetManifests_GoodResponse_V1_28", "[RestSource][Interface_1_28]")
296435 REQUIRE (manifest.Moniker == " FooBarMoniker" );
297436 REQUIRE (manifest.Channel == " " );
298437 REQUIRE (manifest.ManifestVersion == AppInstaller::Manifest::ManifestVer{ " 1.28.0" });
438+ sampleManifest.VerifyLocalizations_AllFields (manifest);
299439 sampleManifest.VerifyInstallers_AllFields (manifest);
300440}
0 commit comments