Skip to content

Commit

Permalink
Update Vestris.ResourceLib to v2.2.0 (microsoft#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft authored and vedantmgoyal9 committed Jul 9, 2024
1 parent 4d8688f commit f839dee
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 209 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Installers:
InstallerType: exe
InstallerSha256: A7803233EEDB6A4B59B3024CCF9292A6FFFB94507DC998AA67C5B745D197A5DC
ProductCode: FakeProductCode
PackageFamilyName: FakePackageFamilyName
PackageFamilyName: Fake.PackageFamilyName_8wekyb3d8bbwe
Platform:
- Windows.Desktop
PackageLocale: en-US
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,22 @@ public void TearDown()
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[Test]
public async Task UpdateCommandGitHubManifestTest()
public async Task UpdateAndVerifyManifestsCreated()
{
string installerUrl = $"https://fakedomain.com/{TestConstants.TestExeInstaller}";
TestUtils.InitializeMockDownloads(TestConstants.TestExeInstaller);

string packageIdentifier = "TestPublisher.SingleExe";
string version = "1.2.3.4";
(UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData(TestConstants.TestPackageIdentifier, version, this.tempPath, null);
(UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData(packageIdentifier, version, this.tempPath, new[] { $"{installerUrl}" });
var updatedManifests = await command.ExecuteManifestUpdate(initialManifestContent, this.testCommandEvent);
ClassicAssert.IsTrue(updatedManifests, "Command should have succeeded");

string manifestDir = Utils.GetAppManifestDirPath(TestConstants.TestPackageIdentifier, version);
string manifestDir = Utils.GetAppManifestDirPath(packageIdentifier, version);
var updatedManifestContents = Directory.GetFiles(Path.Combine(this.tempPath, manifestDir)).Select(f => File.ReadAllText(f));
ClassicAssert.IsTrue(updatedManifestContents.Any(), "Updated manifests were not created successfully");
Manifests manifestsToValidate = Serialization.DeserializeManifestContents(updatedManifestContents);
ClassicAssert.AreEqual(version, manifestsToValidate.VersionManifest.PackageVersion, $"Failed to update version of {TestConstants.TestPackageIdentifier}");
ClassicAssert.AreEqual(version, manifestsToValidate.VersionManifest.PackageVersion, $"Failed to update version of {packageIdentifier}");
}

/// <summary>
Expand Down Expand Up @@ -598,7 +602,7 @@ public async Task UpdatePreservesExistingValues()
ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded");
var updatedInstallerManifest = updatedManifests.InstallerManifest;
ClassicAssert.AreEqual("FakeProductCode", updatedInstallerManifest.ProductCode, "Existing value for ProductCode was overwritten.");
ClassicAssert.AreEqual("FakePackageFamilyName", updatedInstallerManifest.PackageFamilyName, "Existing value for PackageFamilyName was overwritten.");
ClassicAssert.AreEqual("Fake.PackageFamilyName_8wekyb3d8bbwe", updatedInstallerManifest.PackageFamilyName, "Existing value for PackageFamilyName was overwritten.");
ClassicAssert.IsNotNull(updatedInstallerManifest.Platform, "Existing value for Platform was overwritten.;");
}

Expand Down
Loading

0 comments on commit f839dee

Please sign in to comment.