Skip to content

Commit

Permalink
Add smoke test for powershell module
Browse files Browse the repository at this point in the history
  • Loading branch information
Trenly committed Jan 11, 2023
1 parent 43f7bbb commit a44816b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/AppInstallerCLIE2ETests/PowerShell/WinGetClientModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,28 @@ public void InstallWinGetPackage()
Assert.IsTrue(!string.IsNullOrEmpty(uninstallResult.StdOut));
}

/// <summary>
/// Tests Install-WinGetPackage -Custom {0}.
/// </summary>
[Test]
public void InstallWinGetPackageWithCustomArgument()
{
if (!Environment.Is64BitProcess)
{
return;
}

var installResult = TestCommon.RunPowerShellCoreCommandWithResult(Constants.InstallCmdlet, $"-Id {Constants.ExeInstallerPackageId} -Custom /MyAppendedSwitch");
var uninstallResult = TestCommon.RunPowerShellCoreCommandWithResult(Constants.UninstallCmdlet, $"-Id {Constants.ExeInstallerPackageId}");

Assert.AreEqual(Constants.ErrorCode.S_OK, installResult.ExitCode, $"ExitCode: {installResult.ExitCode}; Failed with the following output: {installResult.StdOut}; {installResult.StdErr}");
Assert.AreEqual(Constants.ErrorCode.S_OK, uninstallResult.ExitCode, $"Failed with the following output: {uninstallResult.StdOut}");

Assert.IsTrue(!string.IsNullOrEmpty(installResult.StdOut));
Assert.IsTrue(installResult.StdOut.IndexOf("/MyAppendedSwitch") != -1);
Assert.IsTrue(!string.IsNullOrEmpty(uninstallResult.StdOut));
}

/// <summary>
/// Tests Update-WinGetPackage.
/// </summary>
Expand Down

0 comments on commit a44816b

Please sign in to comment.