aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2023-01-14 22:05:32 -0600
committerSean Hall <r.sean.hall@gmail.com>2023-01-14 22:53:13 -0600
commitfb8903d9a185a020d54d2bb001f4331caf7c3825 (patch)
tree3f71159bebf3be295001625e5dff6def3cea15ef /src/test/burn
parent46beca0ebe4d06797617ccdab7171b4e64f435ca (diff)
downloadwix-fb8903d9a185a020d54d2bb001f4331caf7c3825.tar.gz
wix-fb8903d9a185a020d54d2bb001f4331caf7c3825.tar.bz2
wix-fb8903d9a185a020d54d2bb001f4331caf7c3825.zip
Improve test coverage for recent Burn changes.
7068, PR 318
Diffstat (limited to 'src/test/burn')
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
index d9eb36ba..65d0c9cd 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
@@ -15,6 +15,7 @@ namespace WixToolsetTest.BurnE2E
15 [RuntimeFact] 15 [RuntimeFact]
16 public void AllowsBAToKeepRegistration() 16 public void AllowsBAToKeepRegistration()
17 { 17 {
18 const string fakeInstallDay = "20230101";
18 this.CreatePackageInstaller("PackageA"); 19 this.CreatePackageInstaller("PackageA");
19 var bundleA = this.CreateBundleInstaller("BundleA"); 20 var bundleA = this.CreateBundleInstaller("BundleA");
20 var testBAController = this.CreateTestBAController(); 21 var testBAController = this.CreateTestBAController();
@@ -35,6 +36,12 @@ namespace WixToolsetTest.BurnE2E
35 testBAController.SetForceKeepRegistration(null); 36 testBAController.SetForceKeepRegistration(null);
36 testBAController.ResetPackageStates("PackageA"); 37 testBAController.ResetPackageStates("PackageA");
37 38
39 // Pretend the bundle was installed on this day to be able to verify that it is only written on the initial install.
40 using (var registrationKey = initialRegistration.BaseKey.OpenSubKey(initialRegistration.KeyPath, writable: true))
41 {
42 registrationKey.SetValue(GenericArpRegistration.REGISTRY_ARP_INSTALL_DATE, fakeInstallDay);
43 }
44
38 bundleA.Install(); 45 bundleA.Install();
39 var finalRegistration = bundleA.VerifyRegisteredAndInPackageCache(); 46 var finalRegistration = bundleA.VerifyRegisteredAndInPackageCache();
40 47
@@ -42,7 +49,7 @@ namespace WixToolsetTest.BurnE2E
42 Assert.NotNull(finalRegistration.EstimatedSize); 49 Assert.NotNull(finalRegistration.EstimatedSize);
43 Assert.InRange(finalRegistration.EstimatedSize.Value, initialRegistration.EstimatedSize.Value + 1, Int32.MaxValue); 50 Assert.InRange(finalRegistration.EstimatedSize.Value, initialRegistration.EstimatedSize.Value + 1, Int32.MaxValue);
44 51
45 Assert.Equal(initialRegistration.InstallDate, finalRegistration.InstallDate); 52 Assert.Equal(fakeInstallDay, finalRegistration.InstallDate);
46 } 53 }
47 54
48 [RuntimeFact] 55 [RuntimeFact]