diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-12-31 18:20:50 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-01-01 10:24:08 -0600 |
| commit | 95b1be66d4c16b1b05b761c1771df229ac0e539c (patch) | |
| tree | 7ea6a46cd25ea83c41d0a7ba66df177925d95f44 /src | |
| parent | 5be795c6bcbc03bc37f7cf7c758298ccfaa884ca (diff) | |
| download | wix-95b1be66d4c16b1b05b761c1771df229ac0e539c.tar.gz wix-95b1be66d4c16b1b05b761c1771df229ac0e539c.tar.bz2 wix-95b1be66d4c16b1b05b761c1771df229ac0e539c.zip | |
Try to get more helpful test failure messages.
Diffstat (limited to 'src')
30 files changed, 145 insertions, 90 deletions
diff --git a/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs b/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs index 8705ed13..39a92024 100644 --- a/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs +++ b/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs | |||
| @@ -5,6 +5,7 @@ namespace WixToolsetTest.Mba.Core | |||
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using System.Runtime.InteropServices; | 7 | using System.Runtime.InteropServices; |
| 8 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Mba.Core; | 9 | using WixToolset.Mba.Core; |
| 9 | using Xunit; | 10 | using Xunit; |
| 10 | 11 | ||
| @@ -45,7 +46,7 @@ namespace WixToolsetTest.Mba.Core | |||
| 45 | Assert.Equal(baFactory.BA.Command.Display, command.display); | 46 | Assert.Equal(baFactory.BA.Command.Display, command.display); |
| 46 | 47 | ||
| 47 | var mbaCommand = baFactory.BA.Command.ParseCommandLine(); | 48 | var mbaCommand = baFactory.BA.Command.ParseCommandLine(); |
| 48 | Assert.Equal(mbaCommand.UnknownCommandLineArgs, new string[] { "this", "is a", "test" }); | 49 | WixAssert.CompareLineByLine(mbaCommand.UnknownCommandLineArgs, new string[] { "this", "is a", "test" }); |
| 49 | Assert.Equal(mbaCommand.Variables, new KeyValuePair<string, string>[] | 50 | Assert.Equal(mbaCommand.Variables, new KeyValuePair<string, string>[] |
| 50 | { | 51 | { |
| 51 | new KeyValuePair<string, string>("VariableA", "AVariable"), | 52 | new KeyValuePair<string, string>("VariableA", "AVariable"), |
diff --git a/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj b/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj index af3a09b0..39d4def3 100644 --- a/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj +++ b/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj | |||
| @@ -15,6 +15,11 @@ | |||
| 15 | </ItemGroup> | 15 | </ItemGroup> |
| 16 | 16 | ||
| 17 | <ItemGroup> | 17 | <ItemGroup> |
| 18 | <!-- <PackageReference Include="WixBuildTools.TestSupport" /> --> | ||
| 19 | <ProjectReference Include="..\..\..\..\internal\WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj" /> | ||
| 20 | </ItemGroup> | ||
| 21 | |||
| 22 | <ItemGroup> | ||
| 18 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> | 23 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> |
| 19 | <PackageReference Include="xunit" /> | 24 | <PackageReference Include="xunit" /> |
| 20 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> | 25 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> |
diff --git a/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs b/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs index 8a65c2d4..cd485fd2 100644 --- a/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs +++ b/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs | |||
| @@ -5,6 +5,7 @@ namespace WixToolsetTest.Data | |||
| 5 | using System; | 5 | using System; |
| 6 | using System.IO; | 6 | using System.IO; |
| 7 | using System.Linq; | 7 | using System.Linq; |
| 8 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Data; | 9 | using WixToolset.Data; |
| 9 | using WixToolset.Data.Bind; | 10 | using WixToolset.Data.Bind; |
| 10 | using WixToolset.Data.Symbols; | 11 | using WixToolset.Data.Symbols; |
| @@ -375,7 +376,7 @@ namespace WixToolsetTest.Data | |||
| 375 | var loc = loaded.Localizations.Single(); | 376 | var loc = loaded.Localizations.Single(); |
| 376 | Assert.Equal(65001, loc.Codepage); | 377 | Assert.Equal(65001, loc.Codepage); |
| 377 | Assert.Empty(loc.Culture); | 378 | Assert.Empty(loc.Culture); |
| 378 | Assert.Equal(new[] | 379 | WixAssert.CompareLineByLine(new[] |
| 379 | { | 380 | { |
| 380 | "TestVar1/TestValue1/False", | 381 | "TestVar1/TestValue1/False", |
| 381 | "TestVar2/TestValue2/True", | 382 | "TestVar2/TestValue2/True", |
diff --git a/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj b/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj index f6e10488..36220fb7 100644 --- a/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj +++ b/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj | |||
| @@ -13,6 +13,11 @@ | |||
| 13 | </ItemGroup> | 13 | </ItemGroup> |
| 14 | 14 | ||
| 15 | <ItemGroup> | 15 | <ItemGroup> |
| 16 | <!-- <PackageReference Include="WixBuildTools.TestSupport" /> --> | ||
| 17 | <ProjectReference Include="..\..\..\..\internal\WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj" /> | ||
| 18 | </ItemGroup> | ||
| 19 | |||
| 20 | <ItemGroup> | ||
| 16 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> | 21 | <PackageReference Include="Microsoft.NET.Test.Sdk" /> |
| 17 | <PackageReference Include="xunit" /> | 22 | <PackageReference Include="xunit" /> |
| 18 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> | 23 | <PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" /> |
diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs index edb4f889..d8f1c9ea 100644 --- a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs +++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.DifxApp | |||
| 17 | var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder }); | 17 | var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder }); |
| 18 | 18 | ||
| 19 | var results = build.BuildAndQuery(Build, "CustomAction"); | 19 | var results = build.BuildAndQuery(Build, "CustomAction"); |
| 20 | Assert.Equal(new[] | 20 | WixAssert.CompareLineByLine(new[] |
| 21 | { | 21 | { |
| 22 | "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t", | 22 | "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t", |
| 23 | "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", | 23 | "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", |
diff --git a/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs b/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs index 81a5fb00..ae8bbbf0 100644 --- a/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs +++ b/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.DirectX | |||
| 17 | var build = new Builder(folder, typeof(DirectXExtensionFactory), new[] { folder }); | 17 | var build = new Builder(folder, typeof(DirectXExtensionFactory), new[] { folder }); |
| 18 | 18 | ||
| 19 | var results = build.BuildAndQuery(Build, "CustomAction"); | 19 | var results = build.BuildAndQuery(Build, "CustomAction"); |
| 20 | Assert.Equal(new[] | 20 | WixAssert.CompareLineByLine(new[] |
| 21 | { | 21 | { |
| 22 | "CustomAction:WixQueryDirectXCaps\t65\tDirectXCA\tWixQueryDirectXCaps\t", | 22 | "CustomAction:WixQueryDirectXCaps\t65\tDirectXCA\tWixQueryDirectXCaps\t", |
| 23 | }, results); | 23 | }, results); |
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs index 5804675c..f7df46e6 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.Firewall | |||
| 17 | var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder }); | 17 | var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder }); |
| 18 | 18 | ||
| 19 | var results = build.BuildAndQuery(Build, "Wix4FirewallException", "CustomAction"); | 19 | var results = build.BuildAndQuery(Build, "Wix4FirewallException", "CustomAction"); |
| 20 | Assert.Equal(new[] | 20 | WixAssert.CompareLineByLine(new[] |
| 21 | { | 21 | { |
| 22 | "CustomAction:Wix4ExecFirewallExceptionsInstall_X86\t3073\tWix4FWCA_X86\tExecFirewallExceptions\t", | 22 | "CustomAction:Wix4ExecFirewallExceptionsInstall_X86\t3073\tWix4FWCA_X86\tExecFirewallExceptions\t", |
| 23 | "CustomAction:Wix4ExecFirewallExceptionsUninstall_X86\t3073\tWix4FWCA_X86\tExecFirewallExceptions\t", | 23 | "CustomAction:Wix4ExecFirewallExceptionsUninstall_X86\t3073\tWix4FWCA_X86\tExecFirewallExceptions\t", |
| @@ -36,7 +36,7 @@ namespace WixToolsetTest.Firewall | |||
| 36 | var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder }); | 36 | var build = new Builder(folder, typeof(FirewallExtensionFactory), new[] { folder }); |
| 37 | 37 | ||
| 38 | var results = build.BuildAndQuery(BuildARM64, "Wix4FirewallException", "CustomAction"); | 38 | var results = build.BuildAndQuery(BuildARM64, "Wix4FirewallException", "CustomAction"); |
| 39 | Assert.Equal(new[] | 39 | WixAssert.CompareLineByLine(new[] |
| 40 | { | 40 | { |
| 41 | "CustomAction:Wix4ExecFirewallExceptionsInstall_A64\t3073\tWix4FWCA_A64\tExecFirewallExceptions\t", | 41 | "CustomAction:Wix4ExecFirewallExceptionsInstall_A64\t3073\tWix4FWCA_A64\tExecFirewallExceptions\t", |
| 42 | "CustomAction:Wix4ExecFirewallExceptionsUninstall_A64\t3073\tWix4FWCA_A64\tExecFirewallExceptions\t", | 42 | "CustomAction:Wix4ExecFirewallExceptionsUninstall_A64\t3073\tWix4FWCA_A64\tExecFirewallExceptions\t", |
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs index 26c95050..541426a8 100644 --- a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs +++ b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.Iis | |||
| 17 | var build = new Builder(folder, typeof(IisExtensionFactory), new[] { folder }); | 17 | var build = new Builder(folder, typeof(IisExtensionFactory), new[] { folder }); |
| 18 | 18 | ||
| 19 | var results = build.BuildAndQuery(Build, "Wix4IIsWebSite", "Wix4IIsWebAddress"); | 19 | var results = build.BuildAndQuery(Build, "Wix4IIsWebSite", "Wix4IIsWebAddress"); |
| 20 | Assert.Equal(new[] | 20 | WixAssert.CompareLineByLine(new[] |
| 21 | { | 21 | { |
| 22 | "Wix4IIsWebAddress:TestAddress\tTest\t\t[PORT]\t\t0", | 22 | "Wix4IIsWebAddress:TestAddress\tTest\t\t[PORT]\t\t0", |
| 23 | "Wix4IIsWebSite:Test\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest web server\t\tTestWebSiteProductDirectory\t2\t2\tTestAddress\tReadAndExecute\t\t\t\t", | 23 | "Wix4IIsWebSite:Test\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tTest web server\t\tTestWebSiteProductDirectory\t2\t2\tTestAddress\tReadAndExecute\t\t\t\t", |
diff --git a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs index 057b0a9d..a0fac3ca 100644 --- a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs +++ b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.Msmq | |||
| 17 | var build = new Builder(folder, typeof(MsmqExtensionFactory), new[] { folder }); | 17 | var build = new Builder(folder, typeof(MsmqExtensionFactory), new[] { folder }); |
| 18 | 18 | ||
| 19 | var results = build.BuildAndQuery(Build, "MessageQueue"); | 19 | var results = build.BuildAndQuery(Build, "MessageQueue"); |
| 20 | Assert.Equal(new[] | 20 | WixAssert.CompareLineByLine(new[] |
| 21 | { | 21 | { |
| 22 | "MessageQueue:TestMQ\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\t\t\tMQLabel\t\tMQPath\t\t\t\t0", | 22 | "MessageQueue:TestMQ\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\t\t\tMQLabel\t\tMQPath\t\t\t\t0", |
| 23 | }, results); | 23 | }, results); |
diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs b/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs index 72d4a682..4b8b826e 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs | |||
| @@ -68,7 +68,7 @@ namespace WixToolsetTest.Netfx | |||
| 68 | var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder }); | 68 | var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder }); |
| 69 | 69 | ||
| 70 | var results = build.BuildAndQuery(Build, "Binary", "CustomAction", "Wix4NetFxNativeImage"); | 70 | var results = build.BuildAndQuery(Build, "Binary", "CustomAction", "Wix4NetFxNativeImage"); |
| 71 | Assert.Equal(new[] | 71 | WixAssert.CompareLineByLine(new[] |
| 72 | { | 72 | { |
| 73 | "Binary:Wix4NetFxCA_X86\t[Binary data]", | 73 | "Binary:Wix4NetFxCA_X86\t[Binary data]", |
| 74 | "CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X86\t3649\tWix4NetFxCA_X86\tExecNetFx\t", | 74 | "CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X86\t3649\tWix4NetFxCA_X86\tExecNetFx\t", |
| @@ -87,7 +87,7 @@ namespace WixToolsetTest.Netfx | |||
| 87 | var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder }); | 87 | var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder }); |
| 88 | 88 | ||
| 89 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4NetFxNativeImage"); | 89 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4NetFxNativeImage"); |
| 90 | Assert.Equal(new[] | 90 | WixAssert.CompareLineByLine(new[] |
| 91 | { | 91 | { |
| 92 | "Binary:Wix4NetFxCA_X64\t[Binary data]", | 92 | "Binary:Wix4NetFxCA_X64\t[Binary data]", |
| 93 | "CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X64\t3649\tWix4NetFxCA_X64\tExecNetFx\t", | 93 | "CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_X64\t3649\tWix4NetFxCA_X64\tExecNetFx\t", |
| @@ -106,7 +106,7 @@ namespace WixToolsetTest.Netfx | |||
| 106 | var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder }); | 106 | var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder }); |
| 107 | 107 | ||
| 108 | var results = build.BuildAndQuery(BuildARM64, "Binary", "CustomAction", "Wix4NetFxNativeImage"); | 108 | var results = build.BuildAndQuery(BuildARM64, "Binary", "CustomAction", "Wix4NetFxNativeImage"); |
| 109 | Assert.Equal(new[] | 109 | WixAssert.CompareLineByLine(new[] |
| 110 | { | 110 | { |
| 111 | "Binary:Wix4NetFxCA_A64\t[Binary data]", | 111 | "Binary:Wix4NetFxCA_A64\t[Binary data]", |
| 112 | "CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_A64\t3649\tWix4NetFxCA_A64\tExecNetFx\t", | 112 | "CustomAction:Wix4NetFxExecuteNativeImageCommitInstall_A64\t3649\tWix4NetFxCA_A64\tExecNetFx\t", |
diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index 54c4c788..ca36fed5 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs | |||
| @@ -18,7 +18,7 @@ namespace WixToolsetTest.UI | |||
| 18 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 18 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 19 | 19 | ||
| 20 | var results = build.BuildAndQuery(Build, "Property"); | 20 | var results = build.BuildAndQuery(Build, "Property"); |
| 21 | Assert.Equal(new[] | 21 | WixAssert.CompareLineByLine(new[] |
| 22 | { | 22 | { |
| 23 | "Property:WixUI_Mode\tAdvanced", | 23 | "Property:WixUI_Mode\tAdvanced", |
| 24 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | 24 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); |
| @@ -32,7 +32,7 @@ namespace WixToolsetTest.UI | |||
| 32 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 32 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 33 | 33 | ||
| 34 | var results = build.BuildAndQuery(Build, "Property"); | 34 | var results = build.BuildAndQuery(Build, "Property"); |
| 35 | Assert.Equal(new[] | 35 | WixAssert.CompareLineByLine(new[] |
| 36 | { | 36 | { |
| 37 | "Property:WixUI_Mode\tFeatureTree", | 37 | "Property:WixUI_Mode\tFeatureTree", |
| 38 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | 38 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); |
| @@ -46,7 +46,7 @@ namespace WixToolsetTest.UI | |||
| 46 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 46 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 47 | 47 | ||
| 48 | var results = build.BuildAndQuery(Build, "Property"); | 48 | var results = build.BuildAndQuery(Build, "Property"); |
| 49 | Assert.Equal(new[] | 49 | WixAssert.CompareLineByLine(new[] |
| 50 | { | 50 | { |
| 51 | "Property:WixUI_Mode\tInstallDir", | 51 | "Property:WixUI_Mode\tInstallDir", |
| 52 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | 52 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); |
| @@ -60,7 +60,7 @@ namespace WixToolsetTest.UI | |||
| 60 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 60 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 61 | 61 | ||
| 62 | var results = build.BuildAndQuery(Build, "Property"); | 62 | var results = build.BuildAndQuery(Build, "Property"); |
| 63 | Assert.Equal(new[] | 63 | WixAssert.CompareLineByLine(new[] |
| 64 | { | 64 | { |
| 65 | "Property:WixUI_Mode\tMinimal", | 65 | "Property:WixUI_Mode\tMinimal", |
| 66 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | 66 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); |
| @@ -74,7 +74,7 @@ namespace WixToolsetTest.UI | |||
| 74 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 74 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 75 | 75 | ||
| 76 | var results = build.BuildAndQuery(Build, "Property"); | 76 | var results = build.BuildAndQuery(Build, "Property"); |
| 77 | Assert.Equal(new[] | 77 | WixAssert.CompareLineByLine(new[] |
| 78 | { | 78 | { |
| 79 | "Property:WixUI_Mode\tMondo", | 79 | "Property:WixUI_Mode\tMondo", |
| 80 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | 80 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); |
| @@ -88,7 +88,7 @@ namespace WixToolsetTest.UI | |||
| 88 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 88 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 89 | 89 | ||
| 90 | var results = build.BuildAndQuery(BuildInGerman, "Control"); | 90 | var results = build.BuildAndQuery(BuildInGerman, "Control"); |
| 91 | Assert.Equal(new[] | 91 | WixAssert.CompareLineByLine(new[] |
| 92 | { | 92 | { |
| 93 | "&Ja", | 93 | "&Ja", |
| 94 | }, results.Where(s => s.StartsWith("Control:ErrorDlg\tY")).Select(s => s.Split('\t')[9]).ToArray()); | 94 | }, results.Where(s => s.StartsWith("Control:ErrorDlg\tY")).Select(s => s.Split('\t')[9]).ToArray()); |
diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs index 1a574261..dc76e8fb 100644 --- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs +++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs | |||
| @@ -16,7 +16,7 @@ namespace WixToolsetTest.VisualStudio | |||
| 16 | var build = new Builder(folder, typeof(VSExtensionFactory), new[] { folder }); | 16 | var build = new Builder(folder, typeof(VSExtensionFactory), new[] { folder }); |
| 17 | 17 | ||
| 18 | var results = build.BuildAndQuery(Build, "CustomAction"); | 18 | var results = build.BuildAndQuery(Build, "CustomAction"); |
| 19 | Assert.Equal(new[] | 19 | WixAssert.CompareLineByLine(new[] |
| 20 | { | 20 | { |
| 21 | "CustomAction:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t", | 21 | "CustomAction:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t", |
| 22 | "CustomAction:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t", | 22 | "CustomAction:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t", |
diff --git a/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h b/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h index 34af4f34..62ace4a9 100644 --- a/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h +++ b/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h | |||
| @@ -29,8 +29,7 @@ namespace TestSupport { | |||
| 29 | 29 | ||
| 30 | static void NotStringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) | 30 | static void NotStringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) |
| 31 | { | 31 | { |
| 32 | IEqualityComparer<String^>^ comparer = ignoreCase ? StringComparer::InvariantCultureIgnoreCase : StringComparer::InvariantCulture; | 32 | WixAssert::NotStringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase); |
| 33 | Assert::NotEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), comparer); | ||
| 34 | } | 33 | } |
| 35 | 34 | ||
| 36 | // For some reason, naming these StringEqual methods "Equal" breaks Intellisense in files that call any overload of the Equal method. | 35 | // For some reason, naming these StringEqual methods "Equal" breaks Intellisense in files that call any overload of the Equal method. |
| @@ -41,8 +40,7 @@ namespace TestSupport { | |||
| 41 | 40 | ||
| 42 | static void StringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) | 41 | static void StringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) |
| 43 | { | 42 | { |
| 44 | IEqualityComparer<String^>^ comparer = ignoreCase ? StringComparer::InvariantCultureIgnoreCase : StringComparer::InvariantCulture; | 43 | WixAssert::StringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase); |
| 45 | Assert::Equal(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), comparer); | ||
| 46 | } | 44 | } |
| 47 | 45 | ||
| 48 | static void Succeeded(HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array<LPCSTR>^ zArgs) | 46 | static void Succeeded(HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array<LPCSTR>^ zArgs) |
diff --git a/src/internal/WixBuildTools.TestSupport/WixAssert.cs b/src/internal/WixBuildTools.TestSupport/WixAssert.cs index 5638a787..938902ec 100644 --- a/src/internal/WixBuildTools.TestSupport/WixAssert.cs +++ b/src/internal/WixBuildTools.TestSupport/WixAssert.cs | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | namespace WixBuildTools.TestSupport | 3 | namespace WixBuildTools.TestSupport |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | ||
| 6 | using System.Linq; | 7 | using System.Linq; |
| 7 | using System.Xml.Linq; | 8 | using System.Xml.Linq; |
| 8 | using Xunit; | 9 | using Xunit; |
| @@ -14,10 +15,10 @@ namespace WixBuildTools.TestSupport | |||
| 14 | for (var i = 0; i < expectedLines.Length; ++i) | 15 | for (var i = 0; i < expectedLines.Length; ++i) |
| 15 | { | 16 | { |
| 16 | Assert.True(actualLines.Length > i, $"{i}: expectedLines longer than actualLines"); | 17 | Assert.True(actualLines.Length > i, $"{i}: expectedLines longer than actualLines"); |
| 17 | Assert.Equal($"{i}: {expectedLines[i]}", $"{i}: {actualLines[i]}"); | 18 | WixAssert.StringEqual($"{i}: {expectedLines[i]}", $"{i}: {actualLines[i]}"); |
| 18 | } | 19 | } |
| 19 | 20 | ||
| 20 | Assert.True(expectedLines.Length == actualLines.Length, "actualLines longer than expectedLines"); | 21 | Assert.True(expectedLines.Length == actualLines.Length, $"actualLines ({actualLines.Length}) longer than expectedLines ({expectedLines.Length})"); |
| 21 | } | 22 | } |
| 22 | 23 | ||
| 23 | public static void CompareXml(XContainer xExpected, XContainer xActual) | 24 | public static void CompareXml(XContainer xExpected, XContainer xActual) |
| @@ -43,5 +44,48 @@ namespace WixBuildTools.TestSupport | |||
| 43 | throw new SucceededException(hr, String.Format(format, formatArgs)); | 44 | throw new SucceededException(hr, String.Format(format, formatArgs)); |
| 44 | } | 45 | } |
| 45 | } | 46 | } |
| 47 | |||
| 48 | public static void StringCollectionEmpty(IList<string> collection) | ||
| 49 | { | ||
| 50 | if (collection.Count > 0) | ||
| 51 | { | ||
| 52 | Assert.True(false, $"The collection was expected to be empty, but instead was [{Environment.NewLine}\"{String.Join($"\", {Environment.NewLine}\"", collection)}\"{Environment.NewLine}]"); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | public static void StringEqual(string expected, string actual, bool ignoreCase = false) | ||
| 57 | { | ||
| 58 | var comparer = ignoreCase ? StringObjectEqualityComparer.InvariantCultureIgnoreCase : StringObjectEqualityComparer.InvariantCulture; | ||
| 59 | Assert.Equal<object>(expected, actual, comparer); | ||
| 60 | } | ||
| 61 | |||
| 62 | public static void NotStringEqual(string expected, string actual, bool ignoreCase = false) | ||
| 63 | { | ||
| 64 | var comparer = ignoreCase ? StringObjectEqualityComparer.InvariantCultureIgnoreCase : StringObjectEqualityComparer.InvariantCulture; | ||
| 65 | Assert.NotEqual<object>(expected, actual, comparer); | ||
| 66 | } | ||
| 67 | |||
| 68 | private class StringObjectEqualityComparer : IEqualityComparer<object> | ||
| 69 | { | ||
| 70 | public static readonly StringObjectEqualityComparer InvariantCultureIgnoreCase = new StringObjectEqualityComparer(true); | ||
| 71 | public static readonly StringObjectEqualityComparer InvariantCulture = new StringObjectEqualityComparer(false); | ||
| 72 | |||
| 73 | private readonly StringComparer _stringComparer; | ||
| 74 | |||
| 75 | public StringObjectEqualityComparer(bool ignoreCase) | ||
| 76 | { | ||
| 77 | this._stringComparer = ignoreCase ? StringComparer.InvariantCultureIgnoreCase : StringComparer.InvariantCulture; | ||
| 78 | } | ||
| 79 | |||
| 80 | public new bool Equals(object x, object y) | ||
| 81 | { | ||
| 82 | return this._stringComparer.Equals((string)x,(string)y); | ||
| 83 | } | ||
| 84 | |||
| 85 | public int GetHashCode(object obj) | ||
| 86 | { | ||
| 87 | return this._stringComparer.GetHashCode((string)obj); | ||
| 88 | } | ||
| 89 | } | ||
| 46 | } | 90 | } |
| 47 | } | 91 | } |
diff --git a/src/test/burn/WixTestTools/BundleVerifier.cs b/src/test/burn/WixTestTools/BundleVerifier.cs index 984df169..54f90870 100644 --- a/src/test/burn/WixTestTools/BundleVerifier.cs +++ b/src/test/burn/WixTestTools/BundleVerifier.cs | |||
| @@ -7,6 +7,7 @@ namespace WixTestTools | |||
| 7 | using System.Linq; | 7 | using System.Linq; |
| 8 | using System.Text; | 8 | using System.Text; |
| 9 | using Microsoft.Win32; | 9 | using Microsoft.Win32; |
| 10 | using WixBuildTools.TestSupport; | ||
| 10 | using WixToolset.Data; | 11 | using WixToolset.Data; |
| 11 | using WixToolset.Data.Symbols; | 12 | using WixToolset.Data.Symbols; |
| 12 | using Xunit; | 13 | using Xunit; |
| @@ -93,7 +94,7 @@ namespace WixTestTools | |||
| 93 | Assert.True(File.Exists(registration.CachePath)); | 94 | Assert.True(File.Exists(registration.CachePath)); |
| 94 | 95 | ||
| 95 | var expectedCachePath = this.GetExpectedCachedBundlePath(); | 96 | var expectedCachePath = this.GetExpectedCachedBundlePath(); |
| 96 | Assert.Equal(expectedCachePath, registration.CachePath, StringComparer.OrdinalIgnoreCase); | 97 | WixAssert.StringEqual(expectedCachePath, registration.CachePath, true); |
| 97 | 98 | ||
| 98 | return registration.CachePath; | 99 | return registration.CachePath; |
| 99 | } | 100 | } |
diff --git a/src/test/burn/WixTestTools/TestTool.cs b/src/test/burn/WixTestTools/TestTool.cs index be5fde42..9c3a3ea6 100644 --- a/src/test/burn/WixTestTools/TestTool.cs +++ b/src/test/burn/WixTestTools/TestTool.cs | |||
| @@ -123,7 +123,7 @@ namespace WixTestTools | |||
| 123 | this.PrintErrors(); | 123 | this.PrintErrors(); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | Assert.Empty(this.Errors); | 126 | WixAssert.StringCollectionEmpty(this.Errors); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | return result; | 129 | return result; |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs index ad62dea6..eae6a03a 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs | |||
| @@ -42,7 +42,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 42 | var fileRows = fileTable.Select(r => new FileRow(r)).OrderBy(f => f.Sequence).ToList(); | 42 | var fileRows = fileTable.Select(r => new FileRow(r)).OrderBy(f => f.Sequence).ToList(); |
| 43 | 43 | ||
| 44 | Assert.Equal(new[] { 1, 2 }, fileRows.Select(f => f.Sequence).ToArray()); | 44 | Assert.Equal(new[] { 1, 2 }, fileRows.Select(f => f.Sequence).ToArray()); |
| 45 | Assert.Equal(new[] { "Notepad.exe", "test.txt" }, fileRows.Select(f => f.Name).ToArray()); | 45 | WixAssert.CompareLineByLine(new[] { "Notepad.exe", "test.txt" }, fileRows.Select(f => f.Name).ToArray()); |
| 46 | 46 | ||
| 47 | var files = Query.GetCabinetFiles(cabPath); | 47 | var files = Query.GetCabinetFiles(cabPath); |
| 48 | Assert.Equal(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); | 48 | Assert.Equal(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); |
| @@ -78,7 +78,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 78 | var fileRows = fileTable.Select(r => new FileRow(r)).OrderBy(f => f.Sequence).ToList(); | 78 | var fileRows = fileTable.Select(r => new FileRow(r)).OrderBy(f => f.Sequence).ToList(); |
| 79 | 79 | ||
| 80 | Assert.Equal(new[] { 1 }, fileRows.Select(f => f.Sequence).ToArray()); | 80 | Assert.Equal(new[] { 1 }, fileRows.Select(f => f.Sequence).ToArray()); |
| 81 | Assert.Equal(new[] { "test.txt" }, fileRows.Select(f => f.Name).ToArray()); | 81 | WixAssert.CompareLineByLine(new[] { "test.txt" }, fileRows.Select(f => f.Name).ToArray()); |
| 82 | 82 | ||
| 83 | var files = Query.GetCabinetFiles(cabPath); | 83 | var files = Query.GetCabinetFiles(cabPath); |
| 84 | Assert.Equal(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); | 84 | Assert.Equal(fileRows.Select(f => f.Id).ToArray(), files.Select(f => f.Name).ToArray()); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs index 636b86a6..7a915eb8 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs | |||
| @@ -100,7 +100,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 100 | "InstallUISequence", | 100 | "InstallUISequence", |
| 101 | "Property", | 101 | "Property", |
| 102 | }).Where(x => !x.StartsWith("Property:") || x.StartsWith("Property:MsiHiddenProperties\t")).ToArray(); | 102 | }).Where(x => !x.StartsWith("Property:") || x.StartsWith("Property:MsiHiddenProperties\t")).ToArray(); |
| 103 | Assert.Equal(new[] | 103 | WixAssert.CompareLineByLine(new[] |
| 104 | { | 104 | { |
| 105 | "ActionText:CustomAction2\tProgess2Text\t", | 105 | "ActionText:CustomAction2\tProgess2Text\t", |
| 106 | "AdminExecuteSequence:CostFinalize\t\t1000", | 106 | "AdminExecuteSequence:CostFinalize\t\t1000", |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs index ee93b03a..b9a6185d 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs | |||
| @@ -36,7 +36,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 36 | 36 | ||
| 37 | Assert.True(File.Exists(msiPath)); | 37 | Assert.True(File.Exists(msiPath)); |
| 38 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTable1" }); | 38 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTable1" }); |
| 39 | Assert.Equal(new[] | 39 | WixAssert.CompareLineByLine(new[] |
| 40 | { | 40 | { |
| 41 | "CustomTable1:Row1\ttest.txt", | 41 | "CustomTable1:Row1\ttest.txt", |
| 42 | "CustomTable1:Row2\ttest.txt", | 42 | "CustomTable1:Row2\ttest.txt", |
| @@ -71,7 +71,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 71 | 71 | ||
| 72 | Assert.True(File.Exists(msiPath)); | 72 | Assert.True(File.Exists(msiPath)); |
| 73 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableLocalized" }); | 73 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableLocalized" }); |
| 74 | Assert.Equal(new[] | 74 | WixAssert.CompareLineByLine(new[] |
| 75 | { | 75 | { |
| 76 | "CustomTableLocalized:Row1\tThis is row one", | 76 | "CustomTableLocalized:Row1\tThis is row one", |
| 77 | "CustomTableLocalized:Row2\tThis is row two", | 77 | "CustomTableLocalized:Row2\tThis is row two", |
| @@ -105,7 +105,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 105 | 105 | ||
| 106 | Assert.True(File.Exists(msiPath)); | 106 | Assert.True(File.Exists(msiPath)); |
| 107 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableWithFile" }); | 107 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableWithFile" }); |
| 108 | Assert.Equal(new[] | 108 | WixAssert.CompareLineByLine(new[] |
| 109 | { | 109 | { |
| 110 | "CustomTableWithFile:Row1\t[Binary data]", | 110 | "CustomTableWithFile:Row1\t[Binary data]", |
| 111 | "CustomTableWithFile:Row2\t[Binary data]", | 111 | "CustomTableWithFile:Row2\t[Binary data]", |
| @@ -151,7 +151,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 151 | 151 | ||
| 152 | Assert.True(File.Exists(msiPath)); | 152 | Assert.True(File.Exists(msiPath)); |
| 153 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableWithFile" }); | 153 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableWithFile" }); |
| 154 | Assert.Equal(new[] | 154 | WixAssert.CompareLineByLine(new[] |
| 155 | { | 155 | { |
| 156 | "CustomTableWithFile:Row1\t[Binary data]", | 156 | "CustomTableWithFile:Row1\t[Binary data]", |
| 157 | "CustomTableWithFile:Row2\t[Binary data]", | 157 | "CustomTableWithFile:Row2\t[Binary data]", |
| @@ -185,7 +185,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 185 | 185 | ||
| 186 | Assert.True(File.Exists(msiPath)); | 186 | Assert.True(File.Exists(msiPath)); |
| 187 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTable2" }); | 187 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTable2" }); |
| 188 | Assert.Empty(results); | 188 | WixAssert.StringCollectionEmpty(results); |
| 189 | } | 189 | } |
| 190 | } | 190 | } |
| 191 | 191 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs index 4195a2a6..1f1a121e 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs | |||
| @@ -165,7 +165,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 165 | var build = new Builder(folder, null, new[] { folder }); | 165 | var build = new Builder(folder, null, new[] { folder }); |
| 166 | 166 | ||
| 167 | var results = build.BuildAndQuery(Build, "Wix4DependencyProvider"); | 167 | var results = build.BuildAndQuery(Build, "Wix4DependencyProvider"); |
| 168 | Assert.Equal(new[] | 168 | WixAssert.CompareLineByLine(new[] |
| 169 | { | 169 | { |
| 170 | "Wix4DependencyProvider:dep74OfIcniaqxA7EprRGBw4Oyy3r8\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t", | 170 | "Wix4DependencyProvider:dep74OfIcniaqxA7EprRGBw4Oyy3r8\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t", |
| 171 | }, results); | 171 | }, results); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs index a61bdff3..d3fc5a86 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs | |||
| @@ -40,7 +40,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 40 | var section = intermediate.Sections.Single(); | 40 | var section = intermediate.Sections.Single(); |
| 41 | 41 | ||
| 42 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | 42 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); |
| 43 | Assert.Equal(new[] | 43 | WixAssert.CompareLineByLine(new[] |
| 44 | { | 44 | { |
| 45 | "INSTALLFOLDER:ProgramFiles6432Folder:MsiPackage", | 45 | "INSTALLFOLDER:ProgramFiles6432Folder:MsiPackage", |
| 46 | "ProgramFiles6432Folder:ProgramFilesFolder:.", | 46 | "ProgramFiles6432Folder:ProgramFilesFolder:.", |
| @@ -78,7 +78,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 78 | var section = intermediate.Sections.Single(); | 78 | var section = intermediate.Sections.Single(); |
| 79 | 79 | ||
| 80 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | 80 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); |
| 81 | Assert.Equal(new[] | 81 | WixAssert.CompareLineByLine(new[] |
| 82 | { | 82 | { |
| 83 | "INSTALLFOLDER:ProgramFiles6432Folder:MsiPackage", | 83 | "INSTALLFOLDER:ProgramFiles6432Folder:MsiPackage", |
| 84 | "ProgramFiles6432Folder:ProgramFiles64Folder:.", | 84 | "ProgramFiles6432Folder:ProgramFiles64Folder:.", |
| @@ -163,7 +163,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 163 | var section = intermediate.Sections.Single(); | 163 | var section = intermediate.Sections.Single(); |
| 164 | 164 | ||
| 165 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | 165 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); |
| 166 | Assert.Equal(new[] | 166 | WixAssert.CompareLineByLine(new[] |
| 167 | { | 167 | { |
| 168 | "dZsSsu81KcG46xXTwc4mTSZO5Zx4:INSTALLFOLDER:dupe", | 168 | "dZsSsu81KcG46xXTwc4mTSZO5Zx4:INSTALLFOLDER:dupe", |
| 169 | "INSTALLFOLDER:ProgramFiles6432Folder:MsiPackage", | 169 | "INSTALLFOLDER:ProgramFiles6432Folder:MsiPackage", |
| @@ -202,7 +202,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 202 | var section = intermediate.Sections.Single(); | 202 | var section = intermediate.Sections.Single(); |
| 203 | 203 | ||
| 204 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | 204 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); |
| 205 | Assert.Equal(new[] | 205 | WixAssert.CompareLineByLine(new[] |
| 206 | { | 206 | { |
| 207 | "BinFolder:ProgramFilesFolder:Example Corporation\\Test Product\\bin", | 207 | "BinFolder:ProgramFilesFolder:Example Corporation\\Test Product\\bin", |
| 208 | "ProgramFilesFolder:TARGETDIR:PFiles", | 208 | "ProgramFilesFolder:TARGETDIR:PFiles", |
| @@ -211,7 +211,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 211 | 211 | ||
| 212 | var data = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | 212 | var data = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); |
| 213 | var directoryRows = data.Tables["Directory"].Rows; | 213 | var directoryRows = data.Tables["Directory"].Rows; |
| 214 | Assert.Equal(new[] | 214 | WixAssert.CompareLineByLine(new[] |
| 215 | { | 215 | { |
| 216 | "d4EceYatXTyy8HXPt5B6DT9Rj.wE:ProgramFilesFolder:u7-b4gch|Example Corporation", | 216 | "d4EceYatXTyy8HXPt5B6DT9Rj.wE:ProgramFilesFolder:u7-b4gch|Example Corporation", |
| 217 | "dSJ1pgiASlW7kJTu0wqsGBklJsS0:d4EceYatXTyy8HXPt5B6DT9Rj.wE:vjj-gxay|Test Product", | 217 | "dSJ1pgiASlW7kJTu0wqsGBklJsS0:d4EceYatXTyy8HXPt5B6DT9Rj.wE:vjj-gxay|Test Product", |
| @@ -250,7 +250,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 250 | var section = intermediate.Sections.Single(); | 250 | var section = intermediate.Sections.Single(); |
| 251 | 251 | ||
| 252 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | 252 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); |
| 253 | Assert.Equal(new[] | 253 | WixAssert.CompareLineByLine(new[] |
| 254 | { | 254 | { |
| 255 | "BinFolder\tProgramFilesFolder\tbin", | 255 | "BinFolder\tProgramFilesFolder\tbin", |
| 256 | "ProgramFilesFolder\tTARGETDIR\tPFiles", | 256 | "ProgramFilesFolder\tTARGETDIR\tPFiles", |
| @@ -259,7 +259,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 259 | 259 | ||
| 260 | var data = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | 260 | var data = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); |
| 261 | var directoryRows = data.Tables["Directory"].Rows; | 261 | var directoryRows = data.Tables["Directory"].Rows; |
| 262 | Assert.Equal(new[] | 262 | WixAssert.CompareLineByLine(new[] |
| 263 | { | 263 | { |
| 264 | "BinFolder\tProgramFilesFolder\tbin", | 264 | "BinFolder\tProgramFilesFolder\tbin", |
| 265 | "ProgramFilesFolder\tTARGETDIR\tPFiles", | 265 | "ProgramFilesFolder\tTARGETDIR\tPFiles", |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index 089658e6..225355bf 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
| @@ -21,7 +21,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 21 | var build = new Builder(folder, typeof(ExampleExtensionFactory), new[] { Path.Combine(folder, "data") }); | 21 | var build = new Builder(folder, typeof(ExampleExtensionFactory), new[] { Path.Combine(folder, "data") }); |
| 22 | 22 | ||
| 23 | var results = build.BuildAndQuery(Build, "Wix4Example"); | 23 | var results = build.BuildAndQuery(Build, "Wix4Example"); |
| 24 | Assert.Equal(new[] | 24 | WixAssert.CompareLineByLine(new[] |
| 25 | { | 25 | { |
| 26 | "Wix4Example:Foo\tBar" | 26 | "Wix4Example:Foo\tBar" |
| 27 | }, results); | 27 | }, results); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs index de18e30c..6cb94de2 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs | |||
| @@ -42,7 +42,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 42 | Assert.Equal(2, mediaSymbols[0].LastSequence); | 42 | Assert.Equal(2, mediaSymbols[0].LastSequence); |
| 43 | Assert.Equal(2, mediaSymbols[1].DiskId); | 43 | Assert.Equal(2, mediaSymbols[1].DiskId); |
| 44 | Assert.Equal(4, mediaSymbols[1].LastSequence); | 44 | Assert.Equal(4, mediaSymbols[1].LastSequence); |
| 45 | Assert.Equal(new[] | 45 | WixAssert.CompareLineByLine(new[] |
| 46 | { | 46 | { |
| 47 | "a1.txt", | 47 | "a1.txt", |
| 48 | "a2.txt", | 48 | "a2.txt", |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs index 17e91692..1c5e68f0 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs | |||
| @@ -59,7 +59,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 59 | 59 | ||
| 60 | var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); | 60 | var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); |
| 61 | var fileRows = data.Tables["File"].Rows; | 61 | var fileRows = data.Tables["File"].Rows; |
| 62 | Assert.Equal(new[] | 62 | WixAssert.CompareLineByLine(new[] |
| 63 | { | 63 | { |
| 64 | "File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE", | 64 | "File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE", |
| 65 | "File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE", | 65 | "File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE", |
| @@ -68,7 +68,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 68 | var cabPath = Path.Combine(intermediateFolder, "msm-test.cab"); | 68 | var cabPath = Path.Combine(intermediateFolder, "msm-test.cab"); |
| 69 | Query.ExtractStream(msmPath, "MergeModule.CABinet", cabPath); | 69 | Query.ExtractStream(msmPath, "MergeModule.CABinet", cabPath); |
| 70 | var files = Query.GetCabinetFiles(cabPath); | 70 | var files = Query.GetCabinetFiles(cabPath); |
| 71 | Assert.Equal(new[] | 71 | WixAssert.CompareLineByLine(new[] |
| 72 | { | 72 | { |
| 73 | "File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE", | 73 | "File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE", |
| 74 | "File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE", | 74 | "File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE", |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index ff241b50..67a5f132 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
| @@ -206,7 +206,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 206 | var error = messages.Single(m => m.Level == MessageLevel.Error); | 206 | var error = messages.Single(m => m.Level == MessageLevel.Error); |
| 207 | var errorMessage = error.ToString(); | 207 | var errorMessage = error.ToString(); |
| 208 | var checkedPaths = errorMessage.Substring(errorMessage.IndexOf(':') + 1).Split(new[] { ',' }).Select(s => s.Trim()).ToArray(); | 208 | var checkedPaths = errorMessage.Substring(errorMessage.IndexOf(':') + 1).Split(new[] { ',' }).Select(s => s.Trim()).ToArray(); |
| 209 | Assert.Equal(new[] | 209 | WixAssert.CompareLineByLine(new[] |
| 210 | { | 210 | { |
| 211 | "test.txt", | 211 | "test.txt", |
| 212 | Path.Combine(folder, "does-not-exist", "test.txt"), | 212 | Path.Combine(folder, "does-not-exist", "test.txt"), |
| @@ -397,7 +397,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 397 | 397 | ||
| 398 | var builtFiles = Directory.GetFiles(Path.Combine(baseFolder, @"bin")); | 398 | var builtFiles = Directory.GetFiles(Path.Combine(baseFolder, @"bin")); |
| 399 | 399 | ||
| 400 | Assert.Equal(new[]{ | 400 | WixAssert.CompareLineByLine(new[]{ |
| 401 | "test.wixipl" | 401 | "test.wixipl" |
| 402 | }, builtFiles.Select(Path.GetFileName).ToArray()); | 402 | }, builtFiles.Select(Path.GetFileName).ToArray()); |
| 403 | } | 403 | } |
| @@ -428,7 +428,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 428 | 428 | ||
| 429 | var builtFiles = Directory.GetFiles(Path.Combine(baseFolder, @"bin")); | 429 | var builtFiles = Directory.GetFiles(Path.Combine(baseFolder, @"bin")); |
| 430 | 430 | ||
| 431 | Assert.Equal(new[]{ | 431 | WixAssert.CompareLineByLine(new[]{ |
| 432 | "test.wixlib" | 432 | "test.wixlib" |
| 433 | }, builtFiles.Select(Path.GetFileName).ToArray()); | 433 | }, builtFiles.Select(Path.GetFileName).ToArray()); |
| 434 | } | 434 | } |
| @@ -573,7 +573,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 573 | Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 573 | Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
| 574 | 574 | ||
| 575 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); | 575 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); |
| 576 | Assert.Equal(new[] | 576 | WixAssert.CompareLineByLine(new[] |
| 577 | { | 577 | { |
| 578 | "culture", | 578 | "culture", |
| 579 | "fileVersion", | 579 | "fileVersion", |
| @@ -583,7 +583,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 583 | "version" | 583 | "version" |
| 584 | }, msiAssemblyNameSymbols.OrderBy(a => a.Name).Select(a => a.Name).ToArray()); | 584 | }, msiAssemblyNameSymbols.OrderBy(a => a.Name).Select(a => a.Name).ToArray()); |
| 585 | 585 | ||
| 586 | Assert.Equal(new[] | 586 | WixAssert.CompareLineByLine(new[] |
| 587 | { | 587 | { |
| 588 | "neutral", | 588 | "neutral", |
| 589 | "3.11.11810.0", | 589 | "3.11.11810.0", |
| @@ -630,7 +630,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 630 | Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 630 | Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); |
| 631 | 631 | ||
| 632 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); | 632 | var msiAssemblyNameSymbols = section.Symbols.OfType<MsiAssemblyNameSymbol>(); |
| 633 | Assert.Equal(new[] | 633 | WixAssert.CompareLineByLine(new[] |
| 634 | { | 634 | { |
| 635 | "culture", | 635 | "culture", |
| 636 | "fileVersion", | 636 | "fileVersion", |
| @@ -639,7 +639,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 639 | "version" | 639 | "version" |
| 640 | }, msiAssemblyNameSymbols.OrderBy(a => a.Name).Select(a => a.Name).ToArray()); | 640 | }, msiAssemblyNameSymbols.OrderBy(a => a.Name).Select(a => a.Name).ToArray()); |
| 641 | 641 | ||
| 642 | Assert.Equal(new[] | 642 | WixAssert.CompareLineByLine(new[] |
| 643 | { | 643 | { |
| 644 | "neutral", | 644 | "neutral", |
| 645 | "2.0.5805.0", | 645 | "2.0.5805.0", |
| @@ -782,13 +782,13 @@ namespace WixToolsetTest.CoreIntegration | |||
| 782 | var section = intermediate.Sections.Single(); | 782 | var section = intermediate.Sections.Single(); |
| 783 | 783 | ||
| 784 | var progids = section.Symbols.OfType<ProgIdSymbol>().OrderBy(symbol => symbol.ProgId).ToList(); | 784 | var progids = section.Symbols.OfType<ProgIdSymbol>().OrderBy(symbol => symbol.ProgId).ToList(); |
| 785 | Assert.Equal(new[] | 785 | WixAssert.CompareLineByLine(new[] |
| 786 | { | 786 | { |
| 787 | "Foo.File.hol", | 787 | "Foo.File.hol", |
| 788 | "Foo.File.hol.15" | 788 | "Foo.File.hol.15" |
| 789 | }, progids.Select(p => p.ProgId).ToArray()); | 789 | }, progids.Select(p => p.ProgId).ToArray()); |
| 790 | 790 | ||
| 791 | Assert.Equal(new[] | 791 | WixAssert.CompareLineByLine(new[] |
| 792 | { | 792 | { |
| 793 | "Foo.File.hol.15", | 793 | "Foo.File.hol.15", |
| 794 | null | 794 | null |
| @@ -823,20 +823,20 @@ namespace WixToolsetTest.CoreIntegration | |||
| 823 | Assert.Equal("I1", substorage.Name); | 823 | Assert.Equal("I1", substorage.Name); |
| 824 | 824 | ||
| 825 | var data = substorage.Data; | 825 | var data = substorage.Data; |
| 826 | Assert.Equal(new[] | 826 | WixAssert.CompareLineByLine(new[] |
| 827 | { | 827 | { |
| 828 | "_SummaryInformation", | 828 | "_SummaryInformation", |
| 829 | "Property", | 829 | "Property", |
| 830 | "Upgrade" | 830 | "Upgrade" |
| 831 | }, data.Tables.Select(t => t.Name).ToArray()); | 831 | }, data.Tables.Select(t => t.Name).ToArray()); |
| 832 | 832 | ||
| 833 | Assert.Equal(new[] | 833 | WixAssert.CompareLineByLine(new[] |
| 834 | { | 834 | { |
| 835 | "INSTANCEPROPERTY\tI1", | 835 | "INSTANCEPROPERTY\tI1", |
| 836 | "ProductName\tMsiPackage (Instance 1)", | 836 | "ProductName\tMsiPackage (Instance 1)", |
| 837 | }, JoinRows(data.Tables["Property"])); | 837 | }, JoinRows(data.Tables["Property"])); |
| 838 | 838 | ||
| 839 | Assert.Equal(new[] | 839 | WixAssert.CompareLineByLine(new[] |
| 840 | { | 840 | { |
| 841 | "{047730A5-30FE-4A62-A520-DA9381B8226A}\t\t1.0.0.0\t1033\t1\t\tWIX_UPGRADE_DETECTED", | 841 | "{047730A5-30FE-4A62-A520-DA9381B8226A}\t\t1.0.0.0\t1033\t1\t\tWIX_UPGRADE_DETECTED", |
| 842 | "{047730A5-30FE-4A62-A520-DA9381B8226A}\t\t1.0.0.0\t1033\t1\t0\t0", | 842 | "{047730A5-30FE-4A62-A520-DA9381B8226A}\t\t1.0.0.0\t1033\t1\t0\t0", |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index b0c659a9..39231cd2 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -488,7 +488,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 488 | 488 | ||
| 489 | Assert.True(File.Exists(msiPath)); | 489 | Assert.True(File.Exists(msiPath)); |
| 490 | var results = Query.QueryDatabaseByTable(msiPath, new[] { "Wix4Example" }); | 490 | var results = Query.QueryDatabaseByTable(msiPath, new[] { "Wix4Example" }); |
| 491 | Assert.Empty(results["Wix4Example"]); | 491 | WixAssert.StringCollectionEmpty(results["Wix4Example"]); |
| 492 | } | 492 | } |
| 493 | } | 493 | } |
| 494 | 494 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index 483e3fd5..8fe790de 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |||
| @@ -43,14 +43,14 @@ namespace WixToolsetTest.CoreIntegration | |||
| 43 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); | 43 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); |
| 44 | 44 | ||
| 45 | var names = Query.GetSubStorageNames(patchPath); | 45 | var names = Query.GetSubStorageNames(patchPath); |
| 46 | Assert.Equal(new[] { "#RTM.1", "RTM.1" }, names); | 46 | WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names); |
| 47 | 47 | ||
| 48 | var cab = Path.Combine(tempFolder, "foo.cab"); | 48 | var cab = Path.Combine(tempFolder, "foo.cab"); |
| 49 | Query.ExtractStream(patchPath, "foo.cab", cab); | 49 | Query.ExtractStream(patchPath, "foo.cab", cab); |
| 50 | Assert.True(File.Exists(cab)); | 50 | Assert.True(File.Exists(cab)); |
| 51 | 51 | ||
| 52 | var files = Query.GetCabinetFiles(cab); | 52 | var files = Query.GetCabinetFiles(cab); |
| 53 | Assert.Equal(new[] { "a.txt", "b.txt" }, files.Select(f => f.Name).ToArray()); | 53 | WixAssert.CompareLineByLine(new[] { "a.txt", "b.txt" }, files.Select(f => f.Name).ToArray()); |
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | 56 | ||
| @@ -75,7 +75,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 75 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); | 75 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); |
| 76 | 76 | ||
| 77 | var names = Query.GetSubStorageNames(patchPath); | 77 | var names = Query.GetSubStorageNames(patchPath); |
| 78 | Assert.Equal(new[] { "#RTM.1", "RTM.1" }, names); | 78 | WixAssert.CompareLineByLine(new[] { "#RTM.1", "RTM.1" }, names); |
| 79 | 79 | ||
| 80 | var cab = Path.Combine(tempFolder, "foo.cab"); | 80 | var cab = Path.Combine(tempFolder, "foo.cab"); |
| 81 | Query.ExtractStream(patchPath, "foo.cab", cab); | 81 | Query.ExtractStream(patchPath, "foo.cab", cab); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs index d7296cfe..00b83de8 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs | |||
| @@ -308,8 +308,8 @@ namespace WixToolsetTest.CoreIntegration | |||
| 308 | Assert.Equal(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); | 308 | Assert.Equal(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); |
| 309 | 309 | ||
| 310 | var examples = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).ToArray(); | 310 | var examples = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).ToArray(); |
| 311 | Assert.Equal(new string[] { "Foo", "Other" }, examples.Select(t => t.Id?.Id).ToArray()); | 311 | WixAssert.CompareLineByLine(new string[] { "Foo", "Other" }, examples.Select(t => t.Id?.Id).ToArray()); |
| 312 | Assert.Equal(new[] { "Bar", "Value" }, examples.Select(t => t[0].AsString()).ToArray()); | 312 | WixAssert.CompareLineByLine(new[] { "Bar", "Value" }, examples.Select(t => t[0].AsString()).ToArray()); |
| 313 | } | 313 | } |
| 314 | } | 314 | } |
| 315 | } | 315 | } |
diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs index 696c73ee..df1a74da 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | |||
| @@ -29,8 +29,8 @@ namespace WixToolsetTest.Sdk | |||
| 29 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 29 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 30 | result.AssertSuccess(); | 30 | result.AssertSuccess(); |
| 31 | 31 | ||
| 32 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 32 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 33 | Assert.Empty(warnings); | 33 | WixAssert.StringCollectionEmpty(warnings); |
| 34 | 34 | ||
| 35 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 35 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| 36 | .Select(s => s.Substring(baseFolder.Length + 1)) | 36 | .Select(s => s.Substring(baseFolder.Length + 1)) |
| @@ -62,8 +62,8 @@ namespace WixToolsetTest.Sdk | |||
| 62 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 62 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 63 | result.AssertSuccess(); | 63 | result.AssertSuccess(); |
| 64 | 64 | ||
| 65 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 65 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 66 | Assert.Empty(warnings); | 66 | WixAssert.StringCollectionEmpty(warnings); |
| 67 | 67 | ||
| 68 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 68 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| 69 | .Select(s => s.Substring(baseFolder.Length + 1)) | 69 | .Select(s => s.Substring(baseFolder.Length + 1)) |
| @@ -96,8 +96,8 @@ namespace WixToolsetTest.Sdk | |||
| 96 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 96 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 97 | result.AssertSuccess(); | 97 | result.AssertSuccess(); |
| 98 | 98 | ||
| 99 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 99 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 100 | Assert.Empty(warnings); | 100 | WixAssert.StringCollectionEmpty(warnings); |
| 101 | 101 | ||
| 102 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 102 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| 103 | .Select(s => s.Substring(baseFolder.Length + 1)) | 103 | .Select(s => s.Substring(baseFolder.Length + 1)) |
| @@ -166,8 +166,8 @@ namespace WixToolsetTest.Sdk | |||
| 166 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 166 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 167 | result.AssertSuccess(); | 167 | result.AssertSuccess(); |
| 168 | 168 | ||
| 169 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 169 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 170 | Assert.Empty(warnings); | 170 | WixAssert.StringCollectionEmpty(warnings); |
| 171 | 171 | ||
| 172 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 172 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| 173 | .Select(s => s.Substring(baseFolder.Length + 1)) | 173 | .Select(s => s.Substring(baseFolder.Length + 1)) |
| @@ -318,8 +318,8 @@ namespace WixToolsetTest.Sdk | |||
| 318 | }); | 318 | }); |
| 319 | result.AssertSuccess(); | 319 | result.AssertSuccess(); |
| 320 | 320 | ||
| 321 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 321 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 322 | Assert.Empty(warnings); | 322 | WixAssert.StringCollectionEmpty(warnings); |
| 323 | } | 323 | } |
| 324 | } | 324 | } |
| 325 | 325 | ||
| @@ -409,7 +409,7 @@ namespace WixToolsetTest.Sdk | |||
| 409 | .Where(s => !allowedFiles.Contains(s)) | 409 | .Where(s => !allowedFiles.Contains(s)) |
| 410 | .OrderBy(s => s) | 410 | .OrderBy(s => s) |
| 411 | .ToArray(); | 411 | .ToArray(); |
| 412 | Assert.Empty(remainingPaths); | 412 | WixAssert.StringCollectionEmpty(remainingPaths); |
| 413 | } | 413 | } |
| 414 | } | 414 | } |
| 415 | 415 | ||
diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs index 8b2e8e3d..cb14bc43 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | |||
| @@ -36,15 +36,15 @@ namespace WixToolsetTest.Sdk | |||
| 36 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); | 36 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); |
| 37 | Assert.Single(heatCommandLines); | 37 | Assert.Single(heatCommandLines); |
| 38 | 38 | ||
| 39 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 39 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 40 | Assert.Empty(warnings); | 40 | WixAssert.StringCollectionEmpty(warnings); |
| 41 | 41 | ||
| 42 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); | 42 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); |
| 43 | Assert.True(File.Exists(generatedFilePath)); | 43 | Assert.True(File.Exists(generatedFilePath)); |
| 44 | 44 | ||
| 45 | var generatedContents = File.ReadAllText(generatedFilePath); | 45 | var generatedContents = File.ReadAllText(generatedFilePath); |
| 46 | var testXml = generatedContents.GetTestXml(); | 46 | var testXml = generatedContents.GetTestXml(); |
| 47 | Assert.Equal(@"<Wix>" + | 47 | WixAssert.StringEqual(@"<Wix>" + |
| 48 | "<Fragment>" + | 48 | "<Fragment>" + |
| 49 | "<DirectoryRef Id='INSTALLFOLDER'>" + | 49 | "<DirectoryRef Id='INSTALLFOLDER'>" + |
| 50 | "<Component Id='HeatFilePackage.wixproj' Guid='*'>" + | 50 | "<Component Id='HeatFilePackage.wixproj' Guid='*'>" + |
| @@ -92,15 +92,15 @@ namespace WixToolsetTest.Sdk | |||
| 92 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); | 92 | var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); |
| 93 | Assert.Equal(2, heatCommandLines.Count()); | 93 | Assert.Equal(2, heatCommandLines.Count()); |
| 94 | 94 | ||
| 95 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 95 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 96 | Assert.Empty(warnings); | 96 | WixAssert.StringCollectionEmpty(warnings); |
| 97 | 97 | ||
| 98 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); | 98 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); |
| 99 | Assert.True(File.Exists(generatedFilePath)); | 99 | Assert.True(File.Exists(generatedFilePath)); |
| 100 | 100 | ||
| 101 | var generatedContents = File.ReadAllText(generatedFilePath); | 101 | var generatedContents = File.ReadAllText(generatedFilePath); |
| 102 | var testXml = generatedContents.GetTestXml(); | 102 | var testXml = generatedContents.GetTestXml(); |
| 103 | Assert.Equal("<Wix>" + | 103 | WixAssert.StringEqual("<Wix>" + |
| 104 | "<Fragment>" + | 104 | "<Fragment>" + |
| 105 | "<DirectoryRef Id='INSTALLFOLDER'>" + | 105 | "<DirectoryRef Id='INSTALLFOLDER'>" + |
| 106 | "<Component Id='MyProgram.txt' Guid='*'>" + | 106 | "<Component Id='MyProgram.txt' Guid='*'>" + |
| @@ -120,7 +120,7 @@ namespace WixToolsetTest.Sdk | |||
| 120 | 120 | ||
| 121 | generatedContents = File.ReadAllText(generatedFilePath); | 121 | generatedContents = File.ReadAllText(generatedFilePath); |
| 122 | testXml = generatedContents.GetTestXml(); | 122 | testXml = generatedContents.GetTestXml(); |
| 123 | Assert.Equal("<Wix>" + | 123 | WixAssert.StringEqual("<Wix>" + |
| 124 | "<Fragment>" + | 124 | "<Fragment>" + |
| 125 | "<DirectoryRef Id='INSTALLFOLDER'>" + | 125 | "<DirectoryRef Id='INSTALLFOLDER'>" + |
| 126 | "<Component Id='MyProgram.json' Guid='*'>" + | 126 | "<Component Id='MyProgram.json' Guid='*'>" + |
| @@ -184,15 +184,15 @@ namespace WixToolsetTest.Sdk | |||
| 184 | Assert.DoesNotContain("-usetoolsversion", heatCommandLine); | 184 | Assert.DoesNotContain("-usetoolsversion", heatCommandLine); |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 187 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 188 | Assert.Empty(warnings); | 188 | WixAssert.StringCollectionEmpty(warnings); |
| 189 | 189 | ||
| 190 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ToolsVersion4Cs.wxs"); | 190 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ToolsVersion4Cs.wxs"); |
| 191 | Assert.True(File.Exists(generatedFilePath)); | 191 | Assert.True(File.Exists(generatedFilePath)); |
| 192 | 192 | ||
| 193 | var generatedContents = File.ReadAllText(generatedFilePath); | 193 | var generatedContents = File.ReadAllText(generatedFilePath); |
| 194 | var testXml = generatedContents.GetTestXml(); | 194 | var testXml = generatedContents.GetTestXml(); |
| 195 | Assert.Equal(@"<Wix>" + | 195 | WixAssert.StringEqual(@"<Wix>" + |
| 196 | "<Fragment>" + | 196 | "<Fragment>" + |
| 197 | "<DirectoryRef Id='ToolsVersion4Cs.Binaries'>" + | 197 | "<DirectoryRef Id='ToolsVersion4Cs.Binaries'>" + |
| 198 | "<Component Id='ToolsVersion4Cs.Binaries.ToolsVersion4Cs.dll' Guid='*'>" + | 198 | "<Component Id='ToolsVersion4Cs.Binaries.ToolsVersion4Cs.dll' Guid='*'>" + |
| @@ -253,7 +253,7 @@ namespace WixToolsetTest.Sdk | |||
| 253 | var section = intermediate.Sections.Single(); | 253 | var section = intermediate.Sections.Single(); |
| 254 | 254 | ||
| 255 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 255 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
| 256 | Assert.Equal(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); | 256 | WixAssert.StringEqual(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); |
| 257 | } | 257 | } |
| 258 | } | 258 | } |
| 259 | 259 | ||
| @@ -301,15 +301,15 @@ namespace WixToolsetTest.Sdk | |||
| 301 | Assert.DoesNotContain("-usetoolsversion", heatCommandLine); | 301 | Assert.DoesNotContain("-usetoolsversion", heatCommandLine); |
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 304 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
| 305 | Assert.Empty(warnings); | 305 | WixAssert.StringCollectionEmpty(warnings); |
| 306 | 306 | ||
| 307 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_SdkStyleCs.wxs"); | 307 | var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_SdkStyleCs.wxs"); |
| 308 | Assert.True(File.Exists(generatedFilePath)); | 308 | Assert.True(File.Exists(generatedFilePath)); |
| 309 | 309 | ||
| 310 | var generatedContents = File.ReadAllText(generatedFilePath); | 310 | var generatedContents = File.ReadAllText(generatedFilePath); |
| 311 | var testXml = generatedContents.GetTestXml(); | 311 | var testXml = generatedContents.GetTestXml(); |
| 312 | Assert.Equal(@"<Wix>" + | 312 | WixAssert.StringEqual(@"<Wix>" + |
| 313 | "<Fragment>" + | 313 | "<Fragment>" + |
| 314 | "<DirectoryRef Id='SdkStyleCs.Binaries'>" + | 314 | "<DirectoryRef Id='SdkStyleCs.Binaries'>" + |
| 315 | "<Component Id='SdkStyleCs.Binaries.SdkStyleCs.dll' Guid='*'>" + | 315 | "<Component Id='SdkStyleCs.Binaries.SdkStyleCs.dll' Guid='*'>" + |
| @@ -368,7 +368,7 @@ namespace WixToolsetTest.Sdk | |||
| 368 | var section = intermediate.Sections.Single(); | 368 | var section = intermediate.Sections.Single(); |
| 369 | 369 | ||
| 370 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 370 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); |
| 371 | Assert.Equal(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); | 371 | WixAssert.StringEqual(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); |
| 372 | } | 372 | } |
| 373 | } | 373 | } |
| 374 | } | 374 | } |
