From 8aafcc72550d89cc43dfcb81012abe8576709660 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 21 Dec 2022 23:06:05 -0800 Subject: Register the InstallDate in Burn Closes 7068 --- src/test/burn/WixTestTools/GenericArpRegistration.cs | 4 ++++ src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'src/test') diff --git a/src/test/burn/WixTestTools/GenericArpRegistration.cs b/src/test/burn/WixTestTools/GenericArpRegistration.cs index d87c4feb..dfddd9a3 100644 --- a/src/test/burn/WixTestTools/GenericArpRegistration.cs +++ b/src/test/burn/WixTestTools/GenericArpRegistration.cs @@ -15,6 +15,7 @@ namespace WixTestTools public const string REGISTRY_ARP_DISPLAY_NAME = "DisplayName"; public const string REGISTRY_ARP_DISPLAY_VERSION = "DisplayVersion"; public const string REGISTRY_ARP_ESTIMATED_SIZE = "EstimatedSize"; + public const string REGISTRY_ARP_INSTALL_DATE = "InstallDate"; public const string REGISTRY_ARP_PUBLISHER = "Publisher"; public const string REGISTRY_ARP_HELP_LINK = "HelpLink"; public const string REGISTRY_ARP_HELP_TELEPHONE = "HelpTelephone"; @@ -42,6 +43,8 @@ namespace WixTestTools public int? EstimatedSize { get; set; } + public string InstallDate { get; set; } + public int? Installed { get; set; } public string ModifyPath { get; set; } @@ -103,6 +106,7 @@ namespace WixTestTools registration.DisplayName = idKey.GetValue(REGISTRY_ARP_DISPLAY_NAME) as string; registration.DisplayVersion = idKey.GetValue(REGISTRY_ARP_DISPLAY_VERSION) as string; registration.EstimatedSize = idKey.GetValue(REGISTRY_ARP_ESTIMATED_SIZE) as int?; + registration.InstallDate = idKey.GetValue(REGISTRY_ARP_INSTALL_DATE) as string; registration.Installed = idKey.GetValue(REGISTRY_ARP_INSTALLED) as int?; registration.ModifyPath = idKey.GetValue(REGISTRY_ARP_MODIFY_PATH) as string; registration.Publisher = idKey.GetValue(REGISTRY_ARP_PUBLISHER) as string; diff --git a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs index b45ec83a..d9eb36ba 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs @@ -25,7 +25,12 @@ namespace WixToolsetTest.BurnE2E bundleA.Install(); var initialRegistration = bundleA.VerifyRegisteredAndInPackageCache(); + var now = DateTime.Now; + var today = now.ToString("yyyyMMdd"); + var yesterday = now.AddDays(-1).ToString("yyyyMMdd"); // check yesterday in case the bundle install crossed the midnight hour. + Assert.NotNull(initialRegistration.EstimatedSize); + Assert.True(initialRegistration.InstallDate == today || initialRegistration.InstallDate == yesterday, $"Installed date should have been {today} or {yesterday}"); testBAController.SetForceKeepRegistration(null); testBAController.ResetPackageStates("PackageA"); @@ -36,6 +41,8 @@ namespace WixToolsetTest.BurnE2E // Verifies https://github.com/wixtoolset/issues/issues/4039 Assert.NotNull(finalRegistration.EstimatedSize); Assert.InRange(finalRegistration.EstimatedSize.Value, initialRegistration.EstimatedSize.Value + 1, Int32.MaxValue); + + Assert.Equal(initialRegistration.InstallDate, finalRegistration.InstallDate); } [RuntimeFact] -- cgit v1.2.3-55-g6feb