From 3add0e56ddc57ddcfeb92c3b4cbb7ad0eee7674f Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 11 Dec 2019 19:08:30 -0500 Subject: Add unit tests written during discovery of errors elsewhere because why not keep 'em? --- src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | 6 +++--- src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | 1 + .../TestData/Environment/Environment.wxs | 1 + .../TestData/ErrorsInUI/PackageComponents.wxs | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index 4d1e35f9..81289e5a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs @@ -277,9 +277,9 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var error = section.Tuples.OfType().Single(); - Assert.Equal(1234, error.Error); - Assert.Equal("Category 55 Emergency Doomsday Crisis", error.Message.Trim()); + var errors = section.Tuples.OfType().ToDictionary(t => t.Error); + Assert.Equal("Category 55 Emergency Doomsday Crisis", errors[1234].Message.Trim()); + Assert.Equal(" ", errors[5678].Message); } } diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 5a78bbc2..200ba7b8 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -454,6 +454,7 @@ namespace WixToolsetTest.CoreIntegration var results = Query.QueryDatabase(msiPath, new[] { "Environment" }); Assert.Equal(new[] { + "Environment:PATH\t=-*PATH\t[INSTALLFOLDER]; ;[~]\tWixEnvironmentTest", "Environment:WixEnvironmentTest1\t=-WixEnvTest1\t\tWixEnvironmentTest", "Environment:WixEnvironmentTest2\t+-WixEnvTest1\t\tWixEnvironmentTest", "Environment:WixEnvironmentTest3\t!-WixEnvTest1\t\tWixEnvironmentTest", diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Environment/Environment.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Environment/Environment.wxs index 284801e2..de9744a7 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Environment/Environment.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Environment/Environment.wxs @@ -7,6 +7,7 @@ + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs index db128695..c9c65fc7 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs @@ -5,6 +5,7 @@ Category 55 Emergency Doomsday Crisis + -- cgit v1.2.3-55-g6feb