Skip to content

Commit 2b46b16

Browse files
committed
Test fixes
1 parent 7f9820e commit 2b46b16

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

src/AppInstallerCLIE2ETests/DSCv3ResourceCommands.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace AppInstallerCLIE2ETests
2121
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1011:Closing square brackets should be spaced correctly", Justification = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3687 pending SC 1.2 release")]
2222
public class DSCv3ResourceCommands
2323
{
24-
private const string DefaultPackageIdentifier = "AppInstallerTest.TestExeInstaller";
24+
private const string DefaultPackageIdentifier = Constants.ExeInstallerPackageId;
2525
private const string DefaultPackageLowVersion = "1.0.0.0";
2626
private const string DefaultPackageMidVersion = "1.1.0.0";
2727
private const string DefaultPackageHighVersion = "2.0.0.0";
@@ -748,7 +748,7 @@ private class PackageResourceData
748748

749749
public string InstallMode { get; set; }
750750

751-
public bool? AcceptAgreements { get; set; }
751+
public bool? AcceptAgreements { get; set; } = true;
752752
}
753753
}
754754
}

src/AppInstallerCLIE2ETests/DownloadCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void DownloadToDefaultDirectory()
5555
var result = TestCommon.RunAICLICommand("download", $"{Constants.ExeInstallerPackageId} --version {packageVersion}");
5656
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode);
5757
string downloadDir = Path.Combine(TestCommon.GetDefaultDownloadDirectory(), $"{Constants.ExeInstallerPackageId}_{packageVersion}");
58-
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", packageVersion, ProcessorArchitecture.X86, TestCommon.Scope.Unknown, PackageInstallerType.Exe);
58+
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", packageVersion, ProcessorArchitecture.X86, TestCommon.Scope.User, PackageInstallerType.Exe);
5959
}
6060

6161
/// <summary>
@@ -67,7 +67,7 @@ public void DownloadToDirectory()
6767
var downloadDir = TestCommon.GetRandomTestDir();
6868
var result = TestCommon.RunAICLICommand("download", $"{Constants.ExeInstallerPackageId} --download-directory {downloadDir}");
6969
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode);
70-
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", "2.0.0.0", ProcessorArchitecture.X86, TestCommon.Scope.Unknown, PackageInstallerType.Exe);
70+
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", "2.0.0.0", ProcessorArchitecture.X86, TestCommon.Scope.User, PackageInstallerType.Exe);
7171
}
7272

7373
/// <summary>

src/AppInstallerCLIE2ETests/Interop/DownloadInterop.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public async Task DownloadToDefaultDirectory()
118118
var packageVersion = "2.0.0.0";
119119
Assert.AreEqual(DownloadResultStatus.Ok, downloadResult.Status);
120120
string downloadDir = Path.Combine(TestCommon.GetDefaultDownloadDirectory(), $"{Constants.ExeInstallerPackageId}_{packageVersion}");
121-
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", packageVersion, ProcessorArchitecture.X86, TestCommon.Scope.Unknown, PackageInstallerType.Exe);
121+
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", packageVersion, ProcessorArchitecture.X86, TestCommon.Scope.User, PackageInstallerType.Exe);
122122
}
123123

124124
/// <summary>
@@ -142,7 +142,7 @@ public async Task DownloadToDirectory()
142142

143143
// Assert
144144
Assert.AreEqual(DownloadResultStatus.Ok, downloadResult.Status);
145-
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", "2.0.0.0", ProcessorArchitecture.X86, TestCommon.Scope.Unknown, PackageInstallerType.Exe);
145+
TestCommon.AssertInstallerDownload(downloadDir, "TestExeInstaller", "2.0.0.0", ProcessorArchitecture.X86, TestCommon.Scope.User, PackageInstallerType.Exe);
146146
}
147147

148148
/// <summary>

src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ public async Task InstallPortableFailsWithCleanup()
482482
public async Task InstallRequireUserScope()
483483
{
484484
// Find package
485-
var searchResult = this.FindOnePackage(this.testSource, PackageMatchField.Id, PackageFieldMatchOption.Equals, "AppInstallerTest.TestExeInstaller");
485+
var searchResult = this.FindOnePackage(this.testSource, PackageMatchField.Id, PackageFieldMatchOption.Equals, "AppInstallerTest.TestExeInstallerNoScope");
486486

487487
// Configure installation
488488
var installOptions = this.TestFactory.CreateInstallOptions();
@@ -505,7 +505,7 @@ public async Task InstallRequireUserScope()
505505
public async Task InstallRequireUserScopeAndUnknown()
506506
{
507507
// Find package
508-
var searchResult = this.FindOnePackage(this.testSource, PackageMatchField.Id, PackageFieldMatchOption.Equals, "AppInstallerTest.TestExeInstaller");
508+
var searchResult = this.FindOnePackage(this.testSource, PackageMatchField.Id, PackageFieldMatchOption.Equals, "AppInstallerTest.TestExeInstallerNoScope");
509509

510510
// Configure installation
511511
var installOptions = this.TestFactory.CreateInstallOptions();
@@ -725,4 +725,4 @@ public async Task InstallMSIX_VerifyInstalledCatalog()
725725
Assert.True(TestCommon.VerifyTestMsixInstalledAndCleanup());
726726
}
727727
}
728-
}
728+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Id: AppInstallerTest.TestExeInstallerNoScope
2+
Name: TestExeInstaller
3+
Version: 1.0.0.0
4+
Publisher: AppInstallerTest
5+
License: Test
6+
Installers:
7+
- Arch: x86
8+
Url: https://localhost:5001/TestKit/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.exe
9+
Sha256: <EXEHASH>
10+
InstallerType: exe
11+
ProductCode: '{A499DD5E-8DC5-4AD2-911A-BCD0263295E9}'
12+
Switches:
13+
Custom: /execustom
14+
SilentWithProgress: /exeswp
15+
Silent: /exesilent
16+
Interactive: /exeinteractive
17+
Language: /exeenus
18+
Log: /LogFile <LOGPATH>
19+
InstallLocation: /InstallDir <INSTALLPATH>
20+
ManifestVersion: 0.1.0

0 commit comments

Comments
 (0)