RestInterface_1_10.cpp (25521B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #include "pch.h" 4 #include "TestCommon.h" 5 #include "TestRestRequestHandler.h" 6 #include <Rest/Schema/1_10/Interface.h> 7 #include <Rest/Schema/IRestClient.h> 8 #include <AppInstallerVersions.h> 9 #include <AppInstallerErrors.h> 10 11 using namespace TestCommon; 12 using namespace AppInstaller::Http; 13 using namespace AppInstaller::Utility; 14 using namespace AppInstaller::Manifest; 15 using namespace AppInstaller::Repository; 16 using namespace AppInstaller::Repository::Rest; 17 using namespace AppInstaller::Repository::Rest::Schema; 18 using namespace AppInstaller::Repository::Rest::Schema::V1_10; 19 20 namespace 21 { 22 const std::string TestRestUriString = "http://restsource.com/api"; 23 24 struct GoodManifest_AllFields 25 { 26 utility::string_t GetSampleManifest_AllFields() 27 { 28 return _XPLATSTR( 29 R"delimiter( 30 { 31 "Data": { 32 "PackageIdentifier": "Foo.Bar", 33 "Versions": [ 34 { 35 "PackageVersion": "3.0.0abc", 36 "DefaultLocale": { 37 "PackageLocale": "en-US", 38 "Publisher": "Foo", 39 "PublisherUrl": "http://publisher.net", 40 "PublisherSupportUrl": "http://publisherSupport.net", 41 "PrivacyUrl": "http://packagePrivacyUrl.net", 42 "Author": "FooBar", 43 "PackageName": "Bar", 44 "PackageUrl": "http://packageUrl.net", 45 "License": "Foo Bar License", 46 "LicenseUrl": "http://licenseUrl.net", 47 "Copyright": "Foo Bar Copyright", 48 "CopyrightUrl": "http://copyrightUrl.net", 49 "ShortDescription": "Foo bar is a foo bar.", 50 "Description": "Foo bar is a placeholder.", 51 "Tags": [ 52 "FooBar", 53 "Foo", 54 "Bar" 55 ], 56 "Moniker": "FooBarMoniker", 57 "ReleaseNotes": "Default release notes", 58 "ReleaseNotesUrl": "https://DefaultReleaseNotes.net", 59 "Agreements": [{ 60 "AgreementLabel": "DefaultLabel", 61 "Agreement": "DefaultText", 62 "AgreementUrl": "https://DefaultAgreementUrl.net" 63 }], 64 "PurchaseUrl": "http://DefaultPurchaseUrl.net", 65 "InstallationNotes": "Default Installation Notes", 66 "Documentations": [{ 67 "DocumentLabel": "Default Document Label", 68 "DocumentUrl": "http://DefaultDocumentUrl.net" 69 }], 70 "Icons": [{ 71 "IconUrl": "https://DefaultTestIcon", 72 "IconFileType": "ico", 73 "IconResolution": "custom", 74 "IconTheme": "default", 75 "IconSha256": "69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123" 76 }] 77 }, 78 "Channel": "", 79 "Locales": [ 80 { 81 "PackageLocale": "fr-Fr", 82 "Publisher": "Foo French", 83 "PublisherUrl": "http://publisher-fr.net", 84 "PublisherSupportUrl": "http://publisherSupport-fr.net", 85 "PrivacyUrl": "http://packagePrivacyUrl-fr.net", 86 "Author": "FooBar French", 87 "PackageName": "Bar", 88 "PackageUrl": "http://packageUrl-fr.net", 89 "License": "Foo Bar License", 90 "LicenseUrl": "http://licenseUrl-fr.net", 91 "Copyright": "Foo Bar Copyright", 92 "CopyrightUrl": "http://copyrightUrl-fr.net", 93 "ShortDescription": "Foo bar is a foo bar French.", 94 "Description": "Foo bar is a placeholder French.", 95 "Tags": [ 96 "FooBarFr", 97 "FooFr", 98 "BarFr" 99 ], 100 "ReleaseNotes": "Release notes", 101 "ReleaseNotesUrl": "https://ReleaseNotes.net", 102 "Agreements": [{ 103 "AgreementLabel": "Label", 104 "Agreement": "Text", 105 "AgreementUrl": "https://AgreementUrl.net" 106 }], 107 "PurchaseUrl": "http://purchaseUrl.net", 108 "InstallationNotes": "Installation Notes", 109 "Documentations": [{ 110 "DocumentLabel": "Document Label", 111 "DocumentUrl": "http://documentUrl.net" 112 }], 113 "Icons": [{ 114 "IconUrl": "https://testIcon", 115 "IconFileType": "png", 116 "IconResolution": "32x32", 117 "IconTheme": "light", 118 "IconSha256": "69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321" 119 }] 120 } 121 ],)delimiter") _XPLATSTR(R"delimiter( 122 "Installers": [ 123 { 124 "InstallerSha256": "011048877dfaef109801b3f3ab2b60afc74f3fc4f7b3430e0c897f5da1df84b6", 125 "InstallerUrl": "http://foobar.zip", 126 "Architecture": "x86", 127 "InstallerLocale": "en-US", 128 "Platform": [ 129 "Windows.Desktop" 130 ], 131 "MinimumOSVersion": "1078", 132 "InstallerType": "zip", 133 "Scope": "user", 134 "InstallModes": [ 135 "interactive" 136 ], 137 "InstallerSwitches": { 138 "Silent": "/s", 139 "SilentWithProgress": "/s", 140 "Interactive": "/i", 141 "InstallLocation": "C:\\Users\\User1", 142 "Log": "/l", 143 "Upgrade": "/u", 144 "Custom": "/custom", 145 "Repair": "/repair" 146 }, 147 "InstallerSuccessCodes": [ 148 0 149 ], 150 "UpgradeBehavior": "deny", 151 "Commands": [ 152 "command1" 153 ], 154 "Protocols": [ 155 "protocol1" 156 ], 157 "FileExtensions": [ 158 ".file-extension" 159 ], 160 "Dependencies": { 161 "WindowsFeatures": [ 162 "feature1" 163 ], 164 "WindowsLibraries": [ 165 "library1" 166 ], 167 "PackageDependencies": [ 168 { 169 "PackageIdentifier": "Foo.Baz", 170 "MinimumVersion": "2.0.0" 171 } 172 ], 173 "ExternalDependencies": [ 174 "FooBarBaz" 175 ] 176 }, 177 "ProductCode": "5b6e0f8a-3bbf-4a17-aefd-024c2b3e075d", 178 "ReleaseDate": "2021-01-01", 179 "InstallerAbortsTerminal": true, 180 "InstallLocationRequired": true, 181 "RequireExplicitUpgrade": true, 182 "UnsupportedOSArchitectures": [ "arm" ], 183 "ElevationRequirement": "elevatesSelf", 184 "AppsAndFeaturesEntries": [{ 185 "DisplayName": "DisplayName", 186 "DisplayVersion": "DisplayVersion", 187 "Publisher": "Publisher", 188 "ProductCode": "ProductCode", 189 "UpgradeCode": "UpgradeCode", 190 "InstallerType": "exe" 191 }], 192 "Markets" : { 193 "AllowedMarkets": [ "US" ] 194 }, 195 "ExpectedReturnCodes": [{ 196 "InstallerReturnCode": 3, 197 "ReturnResponse": "custom", 198 "ReturnResponseUrl": "http://returnResponseUrl.net" 199 }], 200 "NestedInstallerType": "portable", 201 "DisplayInstallWarnings": true, 202 "UnsupportedArguments": [ "log" ], 203 "NestedInstallerFiles": [{ 204 "RelativeFilePath": "test\\app.exe", 205 "PortableCommandAlias": "test.exe" 206 }], 207 "InstallationMetadata": { 208 "DefaultInstallLocation": "%TEMP%\\DefaultInstallLocation", 209 "Files": [{ 210 "RelativeFilePath": "test\\app.exe", 211 "FileSha256": "011048877dfaef109801b3f3ab2b60afc74f3fc4f7b3430e0c897f5da1df84b6", 212 "FileType": "launch", 213 "InvocationParameter": "/parameter", 214 "DisplayName": "test" 215 }] 216 }, 217 "DownloadCommandProhibited": true, 218 "RepairBehavior": "uninstaller", 219 "ArchiveBinariesDependOnPath": true, 220 "Authentication": { 221 "AuthenticationType": "microsoftEntraId", 222 "MicrosoftEntraIdAuthenticationInfo" : { 223 "Resource": "TestResource", 224 "Scope" : "TestScope" 225 } 226 } 227 } 228 ] 229 } 230 ] 231 }, 232 "ContinuationToken": "abcd" 233 })delimiter"); 234 } 235 236 void VerifyLocalizations_AllFields(const AppInstaller::Manifest::Manifest& manifest) 237 { 238 REQUIRE(manifest.DefaultLocalization.Locale == "en-US"); 239 REQUIRE(manifest.DefaultLocalization.Get<Localization::Publisher>() == "Foo"); 240 REQUIRE(manifest.DefaultLocalization.Get<Localization::PublisherUrl>() == "http://publisher.net"); 241 REQUIRE(manifest.DefaultLocalization.Get<Localization::PublisherSupportUrl>() == "http://publisherSupport.net"); 242 REQUIRE(manifest.DefaultLocalization.Get<Localization::PrivacyUrl>() == "http://packagePrivacyUrl.net"); 243 REQUIRE(manifest.DefaultLocalization.Get<Localization::Author>() == "FooBar"); 244 REQUIRE(manifest.DefaultLocalization.Get<Localization::PackageName>() == "Bar"); 245 REQUIRE(manifest.DefaultLocalization.Get<Localization::PackageUrl>() == "http://packageUrl.net"); 246 REQUIRE(manifest.DefaultLocalization.Get<Localization::License>() == "Foo Bar License"); 247 REQUIRE(manifest.DefaultLocalization.Get<Localization::LicenseUrl>() == "http://licenseUrl.net"); 248 REQUIRE(manifest.DefaultLocalization.Get<Localization::Copyright>() == "Foo Bar Copyright"); 249 REQUIRE(manifest.DefaultLocalization.Get<Localization::CopyrightUrl>() == "http://copyrightUrl.net"); 250 REQUIRE(manifest.DefaultLocalization.Get<Localization::ShortDescription>() == "Foo bar is a foo bar."); 251 REQUIRE(manifest.DefaultLocalization.Get<Localization::Description>() == "Foo bar is a placeholder."); 252 REQUIRE(manifest.DefaultLocalization.Get<Localization::Tags>().size() == 3); 253 REQUIRE(manifest.DefaultLocalization.Get<Localization::Tags>().at(0) == "FooBar"); 254 REQUIRE(manifest.DefaultLocalization.Get<Localization::Tags>().at(1) == "Foo"); 255 REQUIRE(manifest.DefaultLocalization.Get<Localization::Tags>().at(2) == "Bar"); 256 REQUIRE(manifest.DefaultLocalization.Get<Localization::ReleaseNotes>() == "Default release notes"); 257 REQUIRE(manifest.DefaultLocalization.Get<Localization::ReleaseNotesUrl>() == "https://DefaultReleaseNotes.net"); 258 REQUIRE(manifest.DefaultLocalization.Get<Localization::Agreements>().size() == 1); 259 REQUIRE(manifest.DefaultLocalization.Get<Localization::Agreements>().at(0).Label == "DefaultLabel"); 260 REQUIRE(manifest.DefaultLocalization.Get<Localization::Agreements>().at(0).AgreementText == "DefaultText"); 261 REQUIRE(manifest.DefaultLocalization.Get<Localization::Agreements>().at(0).AgreementUrl == "https://DefaultAgreementUrl.net"); 262 REQUIRE(manifest.DefaultLocalization.Get<Localization::PurchaseUrl>() == "http://DefaultPurchaseUrl.net"); 263 REQUIRE(manifest.DefaultLocalization.Get<Localization::InstallationNotes>() == "Default Installation Notes"); 264 REQUIRE(manifest.DefaultLocalization.Get<Localization::Documentations>().size() == 1); 265 REQUIRE(manifest.DefaultLocalization.Get<Localization::Documentations>().at(0).DocumentLabel == "Default Document Label"); 266 REQUIRE(manifest.DefaultLocalization.Get<Localization::Documentations>().at(0).DocumentUrl == "http://DefaultDocumentUrl.net"); 267 REQUIRE(manifest.DefaultLocalization.Get<Localization::Icons>().size() == 1); 268 REQUIRE(manifest.DefaultLocalization.Get<Localization::Icons>().at(0).Url == "https://DefaultTestIcon"); 269 REQUIRE(manifest.DefaultLocalization.Get<Localization::Icons>().at(0).FileType == IconFileTypeEnum::Ico); 270 REQUIRE(manifest.DefaultLocalization.Get<Localization::Icons>().at(0).Resolution == IconResolutionEnum::Custom); 271 REQUIRE(manifest.DefaultLocalization.Get<Localization::Icons>().at(0).Theme == IconThemeEnum::Default); 272 REQUIRE(manifest.DefaultLocalization.Get<Localization::Icons>().at(0).Sha256 == AppInstaller::Utility::SHA256::ConvertToBytes("69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123")); 273 274 REQUIRE(manifest.Localizations.size() == 1); 275 ManifestLocalization frenchLocalization = manifest.Localizations.at(0); 276 REQUIRE(frenchLocalization.Locale == "fr-Fr"); 277 REQUIRE(frenchLocalization.Get<Localization::Publisher>() == "Foo French"); 278 REQUIRE(frenchLocalization.Get<Localization::PublisherUrl>() == "http://publisher-fr.net"); 279 REQUIRE(frenchLocalization.Get<Localization::PublisherSupportUrl>() == "http://publisherSupport-fr.net"); 280 REQUIRE(frenchLocalization.Get<Localization::PrivacyUrl>() == "http://packagePrivacyUrl-fr.net"); 281 REQUIRE(frenchLocalization.Get<Localization::Author>() == "FooBar French"); 282 REQUIRE(frenchLocalization.Get<Localization::PackageName>() == "Bar"); 283 REQUIRE(frenchLocalization.Get<Localization::PackageUrl>() == "http://packageUrl-fr.net"); 284 REQUIRE(frenchLocalization.Get<Localization::License>() == "Foo Bar License"); 285 REQUIRE(frenchLocalization.Get<Localization::LicenseUrl>() == "http://licenseUrl-fr.net"); 286 REQUIRE(frenchLocalization.Get<Localization::Copyright>() == "Foo Bar Copyright"); 287 REQUIRE(frenchLocalization.Get<Localization::CopyrightUrl>() == "http://copyrightUrl-fr.net"); 288 REQUIRE(frenchLocalization.Get<Localization::ShortDescription>() == "Foo bar is a foo bar French."); 289 REQUIRE(frenchLocalization.Get<Localization::Description>() == "Foo bar is a placeholder French."); 290 REQUIRE(frenchLocalization.Get<Localization::Tags>().size() == 3); 291 REQUIRE(frenchLocalization.Get<Localization::Tags>().at(0) == "FooBarFr"); 292 REQUIRE(frenchLocalization.Get<Localization::Tags>().at(1) == "FooFr"); 293 REQUIRE(frenchLocalization.Get<Localization::Tags>().at(2) == "BarFr"); 294 REQUIRE(frenchLocalization.Get<Localization::ReleaseNotes>() == "Release notes"); 295 REQUIRE(frenchLocalization.Get<Localization::ReleaseNotesUrl>() == "https://ReleaseNotes.net"); 296 REQUIRE(frenchLocalization.Get<Localization::Agreements>().size() == 1); 297 REQUIRE(frenchLocalization.Get<Localization::Agreements>().at(0).Label == "Label"); 298 REQUIRE(frenchLocalization.Get<Localization::Agreements>().at(0).AgreementText == "Text"); 299 REQUIRE(frenchLocalization.Get<Localization::Agreements>().at(0).AgreementUrl == "https://AgreementUrl.net"); 300 REQUIRE(frenchLocalization.Get<Localization::PurchaseUrl>() == "http://purchaseUrl.net"); 301 REQUIRE(frenchLocalization.Get<Localization::InstallationNotes>() == "Installation Notes"); 302 REQUIRE(frenchLocalization.Get<Localization::Documentations>().size() == 1); 303 REQUIRE(frenchLocalization.Get<Localization::Documentations>().at(0).DocumentLabel == "Document Label"); 304 REQUIRE(frenchLocalization.Get<Localization::Documentations>().at(0).DocumentUrl == "http://documentUrl.net"); 305 REQUIRE(frenchLocalization.Get<Localization::Icons>().size() == 1); 306 REQUIRE(frenchLocalization.Get<Localization::Icons>().at(0).Url == "https://testIcon"); 307 REQUIRE(frenchLocalization.Get<Localization::Icons>().at(0).FileType == IconFileTypeEnum::Png); 308 REQUIRE(frenchLocalization.Get<Localization::Icons>().at(0).Resolution == IconResolutionEnum::Square32); 309 REQUIRE(frenchLocalization.Get<Localization::Icons>().at(0).Theme == IconThemeEnum::Light); 310 REQUIRE(frenchLocalization.Get<Localization::Icons>().at(0).Sha256 == AppInstaller::Utility::SHA256::ConvertToBytes("69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321")); 311 } 312 313 void VerifyInstallers_AllFields(const AppInstaller::Manifest::Manifest& manifest) 314 { 315 REQUIRE(manifest.Installers.size() == 1); 316 317 ManifestInstaller actualInstaller = manifest.Installers.at(0); 318 REQUIRE(actualInstaller.Sha256 == AppInstaller::Utility::SHA256::ConvertToBytes("011048877dfaef109801b3f3ab2b60afc74f3fc4f7b3430e0c897f5da1df84b6")); 319 REQUIRE(actualInstaller.Url == "http://foobar.zip"); 320 REQUIRE(actualInstaller.Arch == Architecture::X86); 321 REQUIRE(actualInstaller.Locale == "en-US"); 322 REQUIRE(actualInstaller.Platform.size() == 1); 323 REQUIRE(actualInstaller.Platform[0] == PlatformEnum::Desktop); 324 REQUIRE(actualInstaller.MinOSVersion == "1078"); 325 REQUIRE(actualInstaller.BaseInstallerType == InstallerTypeEnum::Zip); 326 REQUIRE(actualInstaller.Scope == ScopeEnum::User); 327 REQUIRE(actualInstaller.InstallModes.size() == 1); 328 REQUIRE(actualInstaller.InstallModes.at(0) == InstallModeEnum::Interactive); 329 REQUIRE(actualInstaller.Switches.size() == 8); 330 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::Silent) == "/s"); 331 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::SilentWithProgress) == "/s"); 332 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::Interactive) == "/i"); 333 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::InstallLocation) == "C:\\Users\\User1"); 334 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::Log) == "/l"); 335 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::Update) == "/u"); 336 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::Custom) == "/custom"); 337 REQUIRE(actualInstaller.Switches.at(InstallerSwitchType::Repair) == "/repair"); 338 REQUIRE(actualInstaller.InstallerSuccessCodes.size() == 1); 339 REQUIRE(actualInstaller.InstallerSuccessCodes.at(0) == 0); 340 REQUIRE(actualInstaller.UpdateBehavior == UpdateBehaviorEnum::Deny); 341 REQUIRE(actualInstaller.Commands.at(0) == "command1"); 342 REQUIRE(actualInstaller.Protocols.at(0) == "protocol1"); 343 REQUIRE(actualInstaller.FileExtensions.at(0) == ".file-extension"); 344 REQUIRE(actualInstaller.Dependencies.HasExactDependency(DependencyType::WindowsFeature, "feature1")); 345 REQUIRE(actualInstaller.Dependencies.HasExactDependency(DependencyType::WindowsLibrary, "library1")); 346 REQUIRE(actualInstaller.Dependencies.HasExactDependency(DependencyType::Package, "Foo.Baz", "2.0.0")); 347 REQUIRE(actualInstaller.Dependencies.HasExactDependency(DependencyType::External, "FooBarBaz")); 348 REQUIRE(actualInstaller.PackageFamilyName == ""); 349 REQUIRE(actualInstaller.ProductCode == "5b6e0f8a-3bbf-4a17-aefd-024c2b3e075d"); 350 REQUIRE(actualInstaller.ReleaseDate == "2021-01-01"); 351 REQUIRE(actualInstaller.InstallerAbortsTerminal); 352 REQUIRE(actualInstaller.InstallLocationRequired); 353 REQUIRE(actualInstaller.RequireExplicitUpgrade); 354 REQUIRE(actualInstaller.ElevationRequirement == ElevationRequirementEnum::ElevatesSelf); 355 REQUIRE(actualInstaller.UnsupportedOSArchitectures.size() == 1); 356 REQUIRE(actualInstaller.UnsupportedOSArchitectures.at(0) == Architecture::Arm); 357 REQUIRE(actualInstaller.AppsAndFeaturesEntries.size() == 1); 358 REQUIRE(actualInstaller.AppsAndFeaturesEntries.at(0).DisplayName == "DisplayName"); 359 REQUIRE(actualInstaller.AppsAndFeaturesEntries.at(0).DisplayVersion == "DisplayVersion"); 360 REQUIRE(actualInstaller.AppsAndFeaturesEntries.at(0).Publisher == "Publisher"); 361 REQUIRE(actualInstaller.AppsAndFeaturesEntries.at(0).ProductCode == "ProductCode"); 362 REQUIRE(actualInstaller.AppsAndFeaturesEntries.at(0).UpgradeCode == "UpgradeCode"); 363 REQUIRE(actualInstaller.AppsAndFeaturesEntries.at(0).InstallerType == InstallerTypeEnum::Exe); 364 REQUIRE(actualInstaller.Markets.AllowedMarkets.size() == 1); 365 REQUIRE(actualInstaller.Markets.AllowedMarkets.at(0) == "US"); 366 REQUIRE(actualInstaller.ExpectedReturnCodes.at(3).ReturnResponseEnum == ExpectedReturnCodeEnum::Custom); 367 REQUIRE(actualInstaller.ExpectedReturnCodes.at(3).ReturnResponseUrl == "http://returnResponseUrl.net"); 368 REQUIRE(actualInstaller.NestedInstallerType == InstallerTypeEnum::Portable); 369 REQUIRE(actualInstaller.DisplayInstallWarnings); 370 REQUIRE(actualInstaller.UnsupportedArguments.size() == 1); 371 REQUIRE(actualInstaller.UnsupportedArguments.at(0) == UnsupportedArgumentEnum::Log); 372 REQUIRE(actualInstaller.NestedInstallerFiles.size() == 1); 373 REQUIRE(actualInstaller.NestedInstallerFiles.at(0).RelativeFilePath == "test\\app.exe"); 374 REQUIRE(actualInstaller.NestedInstallerFiles.at(0).PortableCommandAlias == "test.exe"); 375 REQUIRE(actualInstaller.InstallationMetadata.DefaultInstallLocation == "%TEMP%\\DefaultInstallLocation"); 376 REQUIRE(actualInstaller.InstallationMetadata.Files.size() == 1); 377 REQUIRE(actualInstaller.InstallationMetadata.Files.at(0).RelativeFilePath == "test\\app.exe"); 378 REQUIRE(actualInstaller.InstallationMetadata.Files.at(0).FileType == InstalledFileTypeEnum::Launch); 379 REQUIRE(actualInstaller.InstallationMetadata.Files.at(0).FileSha256 == AppInstaller::Utility::SHA256::ConvertToBytes("011048877dfaef109801b3f3ab2b60afc74f3fc4f7b3430e0c897f5da1df84b6")); 380 REQUIRE(actualInstaller.InstallationMetadata.Files.at(0).InvocationParameter == "/parameter"); 381 REQUIRE(actualInstaller.InstallationMetadata.Files.at(0).DisplayName == "test"); 382 REQUIRE(actualInstaller.DownloadCommandProhibited); 383 REQUIRE(actualInstaller.RepairBehavior == RepairBehaviorEnum::Uninstaller); 384 REQUIRE(actualInstaller.ArchiveBinariesDependOnPath); 385 REQUIRE(actualInstaller.AuthInfo.Type == AppInstaller::Authentication::AuthenticationType::MicrosoftEntraId); 386 REQUIRE(actualInstaller.AuthInfo.MicrosoftEntraIdInfo.has_value()); 387 REQUIRE(actualInstaller.AuthInfo.MicrosoftEntraIdInfo->Resource == "TestResource"); 388 REQUIRE(actualInstaller.AuthInfo.MicrosoftEntraIdInfo->Scope == "TestScope"); 389 } 390 }; 391 } 392 393 TEST_CASE("GetManifests_GoodResponse_V1_10", "[RestSource][Interface_1_10]") 394 { 395 GoodManifest_AllFields sampleManifest; 396 utility::string_t sample = sampleManifest.GetSampleManifest_AllFields(); 397 HttpClientHelper helper{ GetTestRestRequestHandler(web::http::status_codes::OK, std::move(sample)) }; 398 Interface v1_10{ TestRestUriString, std::move(helper), {} }; 399 std::vector<Manifest> manifests = v1_10.GetManifests("Foo.Bar"); 400 REQUIRE(manifests.size() == 1); 401 402 // Verify manifest is populated 403 Manifest& manifest = manifests[0]; 404 REQUIRE(manifest.Id == "Foo.Bar"); 405 REQUIRE(manifest.Version == "3.0.0abc"); 406 REQUIRE(manifest.Moniker == "FooBarMoniker"); 407 REQUIRE(manifest.Channel == ""); 408 REQUIRE(manifest.ManifestVersion == AppInstaller::Manifest::ManifestVer{ "1.10.0" }); 409 sampleManifest.VerifyLocalizations_AllFields(manifest); 410 sampleManifest.VerifyInstallers_AllFields(manifest); 411 }