Skip to content

Commit

Permalink
Discard changes to src/WingetCreateTests/WingetCreateTests/UnitTests/…
Browse files Browse the repository at this point in the history
…UpdateCommandTests.cs
  • Loading branch information
vedantmgoyal9 committed Jul 9, 2024
1 parent d3d8860 commit 51b5507
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,18 @@ public void TearDown()
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[Test]
public async Task UpdateAndVerifyManifestsCreated()
public async Task UpdateCommandGitHubManifestTest()
{
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(packageIdentifier, version, this.tempPath, new[] { $"{installerUrl}" });
(UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData(TestConstants.TestPackageIdentifier, version, this.tempPath, null);
var updatedManifests = await command.ExecuteManifestUpdate(initialManifestContent, this.testCommandEvent);
ClassicAssert.IsTrue(updatedManifests, "Command should have succeeded");

string manifestDir = Utils.GetAppManifestDirPath(packageIdentifier, version);
string manifestDir = Utils.GetAppManifestDirPath(TestConstants.TestPackageIdentifier, 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 {packageIdentifier}");
ClassicAssert.AreEqual(version, manifestsToValidate.VersionManifest.PackageVersion, $"Failed to update version of {TestConstants.TestPackageIdentifier}");
}

/// <summary>
Expand Down Expand Up @@ -602,7 +598,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("Fake.PackageFamilyName_8wekyb3d8bbwe", updatedInstallerManifest.PackageFamilyName, "Existing value for PackageFamilyName was overwritten.");
ClassicAssert.AreEqual("FakePackageFamilyName", updatedInstallerManifest.PackageFamilyName, "Existing value for PackageFamilyName was overwritten.");
ClassicAssert.IsNotNull(updatedInstallerManifest.Platform, "Existing value for Platform was overwritten.;");
}

Expand Down

0 comments on commit 51b5507

Please sign in to comment.