From 38afa9e7bc7eacc021f8805f607368a05751e3c3 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 25 Jun 2020 14:43:50 -0700 Subject: The Great Tuple to Symbol Rename (tm) --- .../BundleFixture.cs | 14 ++-- .../ExtensionFixture.cs | 14 ++-- .../LinkerFixture.cs | 12 ++-- .../WixToolsetTest.CoreIntegration/MsiFixture.cs | 76 +++++++++++----------- .../MsiQueryFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/ParseFixture.cs | 4 +- .../WixiplFixture.cs | 28 ++++---- .../WixlibFixture.cs | 38 +++++------ .../WixlibQueryFixture.cs | 16 ++--- 9 files changed, 103 insertions(+), 103 deletions(-) (limited to 'src/test/WixToolsetTest.CoreIntegration') diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index b86e67ff..cf57eae1 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs @@ -12,7 +12,7 @@ namespace WixToolsetTest.CoreIntegration using WixToolset.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Burn; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Xunit; public class BundleFixture @@ -81,14 +81,14 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(wixOutput); var section = intermediate.Sections.Single(); - var bundleTuple = section.Tuples.OfType().Single(); - Assert.Equal("1.0.0.0", bundleTuple.Version); + var bundleSymbol = section.Symbols.OfType().Single(); + Assert.Equal("1.0.0.0", bundleSymbol.Version); - var previousVersion = bundleTuple.Fields[(int)WixBundleTupleFields.Version].PreviousValue; + var previousVersion = bundleSymbol.Fields[(int)WixBundleSymbolFields.Version].PreviousValue; Assert.Equal("!(bind.packageVersion.test.msi)", previousVersion.AsString()); - var msiTuple = section.Tuples.OfType().Single(); - Assert.Equal("test.msi", msiTuple.Id.Id); + var msiSymbol = section.Symbols.OfType().Single(); + Assert.Equal("test.msi", msiSymbol.Id.Id); var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); extractResult.AssertSuccess(); @@ -111,7 +111,7 @@ namespace WixToolsetTest.CoreIntegration var registrationElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration"); var registrationElement = (XmlNode)Assert.Single(registrationElements); - Assert.Equal($"" + + Assert.Equal($"" + "" + "", registrationElement.GetTestXml()); } diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index bad7f3ef..ff0c3258 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs @@ -9,7 +9,7 @@ namespace WixToolsetTest.CoreIntegration using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Xunit; public class ExtensionFixture @@ -58,11 +58,11 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\extest.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); - var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single(); + var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single(); Assert.Equal("Foo", example.Id?.Id); Assert.Equal("Bar", example[0].AsString()); } @@ -96,7 +96,7 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\extest.wixpdb")); var section = intermediate.Sections.Single(); - var property = section.Tuples.OfType().Where(p => p.Id.Id == "ExampleProperty").Single(); + var property = section.Symbols.OfType().Where(p => p.Id.Id == "ExampleProperty").Single(); Assert.Equal("ExampleProperty", property.Id.Id); Assert.Equal("test", property.Value); } @@ -111,7 +111,7 @@ namespace WixToolsetTest.CoreIntegration { var intermediateFolder = fs.GetFolder(); - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => WixRunner.Execute(new[] { "build", diff --git a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index 97e6bde9..5e08ca58 100644 --- a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs @@ -9,7 +9,7 @@ namespace WixToolsetTest.CoreIntegration using WixToolset.Core; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; using Xunit; @@ -27,12 +27,12 @@ namespace WixToolsetTest.CoreIntegration var messaging = serviceProvider.GetService(); messaging.SetListener(listener); - var creator = serviceProvider.GetService(); + var creator = serviceProvider.GetService(); var context = serviceProvider.GetService(); context.Extensions = Enumerable.Empty(); context.ExtensionData = Enumerable.Empty(); context.Intermediates = new[] { intermediate1, intermediate2 }; - context.TupleDefinitionCreator = creator; + context.SymbolDefinitionCreator = creator; var linker = serviceProvider.GetService(); linker.Link(context); @@ -72,10 +72,10 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var actions = section.Tuples.OfType().Where(wat => wat.Action.StartsWith("Set")).ToList(); + var actions = section.Symbols.OfType().Where(wat => wat.Action.StartsWith("Set")).ToList(); Assert.Equal(2, actions.Count); - //Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); - //Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + //Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileSymbolFields.Source].AsPath().Path); + //Assert.Equal(@"test.txt", wixFile[WixFileSymbolFields.Source].PreviousValue.AsPath().Path); } } } diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index fbfebc5b..740d58c7 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs @@ -9,7 +9,7 @@ namespace WixToolsetTest.CoreIntegration using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using Xunit; @@ -51,9 +51,9 @@ namespace WixToolsetTest.CoreIntegration var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().First(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().First(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } @@ -86,9 +86,9 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } @@ -244,14 +244,14 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var errors = section.Tuples.OfType().ToDictionary(t => t.Id.Id); + var errors = section.Symbols.OfType().ToDictionary(t => t.Id.Id); Assert.Equal("Category 55 Emergency Doomsday Crisis", errors["1234"].Message.Trim()); Assert.Equal(" ", errors["5678"].Message); - var customAction1 = section.Tuples.OfType().Where(t => t.Id.Id == "CanWeReferenceAnError_YesWeCan").Single(); + var customAction1 = section.Symbols.OfType().Where(t => t.Id.Id == "CanWeReferenceAnError_YesWeCan").Single(); Assert.Equal("1234", customAction1.Target); - var customAction2 = section.Tuples.OfType().Where(t => t.Id.Id == "TextErrorsWorkOKToo").Single(); + var customAction2 = section.Symbols.OfType().Where(t => t.Id.Id == "TextErrorsWorkOKToo").Single(); Assert.Equal("If you see this, something went wrong.", customAction2.Target); } } @@ -353,10 +353,10 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal("filyIq8rqcxxf903Hsn5K9L0SWV73g", fileTuple.Id.Id); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal("filyIq8rqcxxf903Hsn5K9L0SWV73g", fileSymbol.Id.Id); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); var fileRows = data.Tables["File"].Rows; @@ -405,15 +405,15 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(pdbPath); var section = intermediate.Sections.Single(); - var upgradeTuple = section.Tuples.OfType().Single(); - Assert.False(upgradeTuple.ExcludeLanguages); - Assert.True(upgradeTuple.IgnoreRemoveFailures); - Assert.False(upgradeTuple.VersionMaxInclusive); - Assert.True(upgradeTuple.VersionMinInclusive); - Assert.Equal("13.0.0", upgradeTuple.VersionMax); - Assert.Equal("12.0.0", upgradeTuple.VersionMin); - Assert.False(upgradeTuple.OnlyDetect); - Assert.Equal("BLAHBLAHBLAH", upgradeTuple.ActionProperty); + var upgradeSymbol = section.Symbols.OfType().Single(); + Assert.False(upgradeSymbol.ExcludeLanguages); + Assert.True(upgradeSymbol.IgnoreRemoveFailures); + Assert.False(upgradeSymbol.VersionMaxInclusive); + Assert.True(upgradeSymbol.VersionMinInclusive); + Assert.Equal("13.0.0", upgradeSymbol.VersionMax); + Assert.Equal("12.0.0", upgradeSymbol.VersionMin); + Assert.False(upgradeSymbol.OnlyDetect); + Assert.Equal("BLAHBLAHBLAH", upgradeSymbol.ActionProperty); var pdb = WindowsInstallerData.Load(pdbPath, suppressVersionCheck: false); var secureProperties = pdb.Tables["Property"].Rows.Where(row => row.GetKey() == "SecureCustomProperties").Single(); @@ -581,9 +581,9 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } @@ -617,11 +617,11 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"candle.exe", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\candle.exe"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"candle.exe", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); - var msiAssemblyNameTuples = section.Tuples.OfType(); + var msiAssemblyNameSymbols = section.Symbols.OfType(); Assert.Equal(new[] { "culture", @@ -630,7 +630,7 @@ namespace WixToolsetTest.CoreIntegration "processorArchitecture", "publicKeyToken", "version" - }, msiAssemblyNameTuples.OrderBy(a => a.Name).Select(a => a.Name).ToArray()); + }, msiAssemblyNameSymbols.OrderBy(a => a.Name).Select(a => a.Name).ToArray()); Assert.Equal(new[] { @@ -640,7 +640,7 @@ namespace WixToolsetTest.CoreIntegration "x86", "256B3414DFA97718", "3.0.0.0" - }, msiAssemblyNameTuples.OrderBy(a => a.Name).Select(a => a.Value).ToArray()); + }, msiAssemblyNameSymbols.OrderBy(a => a.Name).Select(a => a.Value).ToArray()); } } @@ -671,7 +671,7 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var platformSummary = section.Tuples.OfType().Single(s => s.PropertyId == SummaryInformationType.PlatformAndLanguage); + var platformSummary = section.Symbols.OfType().Single(s => s.PropertyId == SummaryInformationType.PlatformAndLanguage); Assert.Equal("x64;1033", platformSummary.Value); } } @@ -704,12 +704,12 @@ namespace WixToolsetTest.CoreIntegration var section = intermediate.Sections.Single(); // Only one component is shared. - var sharedComponentTuples = section.Tuples.OfType(); - Assert.Equal(1, sharedComponentTuples.Sum(t => t.Shared ? 1 : 0)); + var sharedComponentSymbols = section.Symbols.OfType(); + Assert.Equal(1, sharedComponentSymbols.Sum(t => t.Shared ? 1 : 0)); // And it is this one. - var sharedComponentTuple = sharedComponentTuples.Single(t => t.Id.Id == "Shared.dll"); - Assert.True(sharedComponentTuple.Shared); + var sharedComponentSymbol = sharedComponentSymbols.Single(t => t.Id.Id == "Shared.dll"); + Assert.True(sharedComponentSymbol.Shared); } } @@ -775,7 +775,7 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var progids = section.Tuples.OfType().OrderBy(tuple => tuple.ProgId).ToList(); + var progids = section.Symbols.OfType().OrderBy(symbol => symbol.ProgId).ToList(); Assert.Equal(new[] { "Foo.File.hol", diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index c78b0c29..078a33d5 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -9,7 +9,7 @@ namespace WixToolsetTest.CoreIntegration using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using Xunit; @@ -1074,7 +1074,7 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - Assert.Empty(section.Tuples.OfType()); + Assert.Empty(section.Symbols.OfType()); var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); Assert.Null(data.Tables["File"]); diff --git a/src/test/WixToolsetTest.CoreIntegration/ParseFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ParseFixture.cs index afb93041..83f74a47 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ParseFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ParseFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.CoreIntegration using System.Linq; using WixToolset.Core; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; using Xunit; @@ -25,7 +25,7 @@ namespace WixToolsetTest.CoreIntegration parseHelper.CreateCustomActionReference(null, section, "CustomAction", Platform.X64, CustomActionPlatforms.X86 | CustomActionPlatforms.ARM); parseHelper.CreateCustomActionReference(null, section, "CustomAction", Platform.X64, CustomActionPlatforms.X86 | CustomActionPlatforms.X64); - var simpleReferences = section.Tuples.OfType(); + var simpleReferences = section.Symbols.OfType(); Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:Wix4CustomAction32_X86").FirstOrDefault()); Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:Wix4CustomArmAction_X86").FirstOrDefault()); Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:Wix4CustomArmAction_A64").FirstOrDefault()); diff --git a/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs index 25067830..942f253f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs @@ -8,7 +8,7 @@ namespace WixToolsetTest.CoreIntegration using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Example.Extension; using Xunit; @@ -62,9 +62,9 @@ namespace WixToolsetTest.CoreIntegration var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().First(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().First(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } @@ -132,14 +132,14 @@ namespace WixToolsetTest.CoreIntegration var section = intermediate.Sections.Single(); { - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } { - var binary = section.Tuples.OfType().Single(); - var path = binary[BinaryTupleFields.Data].AsPath().Path; + var binary = section.Symbols.OfType().Single(); + var path = binary[BinarySymbolFields.Data].AsPath().Path; Assert.StartsWith(Path.Combine(baseFolder, @"obj\Example.Extension"), path); Assert.EndsWith(@"wix-ir\example.txt", path); Assert.Equal(@"BinFromWir", binary.Id.Id); @@ -187,14 +187,14 @@ namespace WixToolsetTest.CoreIntegration var section = intermediate.Sections.Single(); { - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } { - var binary = section.Tuples.OfType().Single(); - var path = binary[BinaryTupleFields.Data].AsPath().Path; + var binary = section.Symbols.OfType().Single(); + var path = binary[BinarySymbolFields.Data].AsPath().Path; Assert.StartsWith(Path.Combine(baseFolder, @"obj\test"), path); Assert.EndsWith(@"wix-ir\example.txt", path); Assert.Equal(@"BinFromWir", binary.Id.Id); diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs index 63771248..6ae2c0b8 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs @@ -9,7 +9,7 @@ namespace WixToolsetTest.CoreIntegration using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Xunit; public class WixlibFixture @@ -80,11 +80,11 @@ namespace WixToolsetTest.CoreIntegration result.AssertSuccess(); var wixlib = Intermediate.Load(wixlibPath); - var binaryTuples = wixlib.Sections.SelectMany(s => s.Tuples).OfType().ToList(); - Assert.Equal(3, binaryTuples.Count); - Assert.Single(binaryTuples.Where(t => t.Data.Path == "wix-ir/foo.dll")); - Assert.Single(binaryTuples.Where(t => t.Data.Path == "wix-ir/foo.dll-1")); - Assert.Single(binaryTuples.Where(t => t.Data.Path == "wix-ir/foo.dll-2")); + var binarySymbols = wixlib.Sections.SelectMany(s => s.Symbols).OfType().ToList(); + Assert.Equal(3, binarySymbols.Count); + Assert.Single(binarySymbols.Where(t => t.Data.Path == "wix-ir/foo.dll")); + Assert.Single(binarySymbols.Where(t => t.Data.Path == "wix-ir/foo.dll-1")); + Assert.Single(binarySymbols.Where(t => t.Data.Path == "wix-ir/foo.dll-2")); } } @@ -138,9 +138,9 @@ namespace WixToolsetTest.CoreIntegration var section = intermediate.Sections.Single(); - var wixFile = section.Tuples.OfType().First(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", wixFile[FileTupleFields.Source].PreviousValue.AsPath().Path); + var wixFile = section.Symbols.OfType().First(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", wixFile[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } @@ -183,11 +183,11 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"example.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); - var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single(); + var example = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).Single(); Assert.Equal("Foo", example.Id?.Id); Assert.Equal("Bar", example[0].AsString()); } @@ -244,13 +244,13 @@ namespace WixToolsetTest.CoreIntegration var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); - var fileTuples = section.Tuples.OfType().OrderBy(t => Path.GetFileName(t.Source.Path)).ToArray(); - Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileTuples[0][FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"example.txt", fileTuples[0][FileTupleFields.Source].PreviousValue.AsPath().Path); - Assert.Equal(Path.Combine(folder, @"data\other.txt"), fileTuples[1][FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"other.txt", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbols = section.Symbols.OfType().OrderBy(t => Path.GetFileName(t.Source.Path)).ToArray(); + Assert.Equal(Path.Combine(folder, @"data\example.txt"), fileSymbols[0][FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"example.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(Path.Combine(folder, @"data\other.txt"), fileSymbols[1][FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"other.txt", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); - var examples = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).ToArray(); + var examples = section.Symbols.Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension).ToArray(); Assert.Equal(new string[] { "Foo", "Other" }, examples.Select(t => t.Id?.Id).ToArray()); Assert.Equal(new[] { "Bar", "Value" }, examples.Select(t => t[0].AsString()).ToArray()); } diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs index 7f9b9686..57351b27 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs @@ -7,7 +7,7 @@ namespace WixToolsetTest.CoreIntegration using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Xunit; public class WixlibQueryFixture @@ -34,9 +34,9 @@ namespace WixToolsetTest.CoreIntegration result.AssertSuccess(); var intermediate = Intermediate.Load(wixlibPath); - var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); - var wixSimpleRefTuples = allTuples.OfType(); - var repRef = wixSimpleRefTuples.Where(t => t.Table == "WixAction" && + var allSymbols = intermediate.Sections.SelectMany(s => s.Symbols); + var wixSimpleRefSymbols = allSymbols.OfType(); + var repRef = wixSimpleRefSymbols.Where(t => t.Table == "WixAction" && t.PrimaryKeys == "InstallExecuteSequence/RemoveExistingProducts") .SingleOrDefault(); Assert.NotNull(repRef); @@ -65,12 +65,12 @@ namespace WixToolsetTest.CoreIntegration result.AssertSuccess(); var intermediate = Intermediate.Load(wixlibPath); - var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); - var typeLibTuple = allTuples.OfType() + var allSymbols = intermediate.Sections.SelectMany(s => s.Symbols); + var typeLibSymbol = allSymbols.OfType() .SingleOrDefault(); - Assert.NotNull(typeLibTuple); + Assert.NotNull(typeLibSymbol); - var fields = typeLibTuple.Fields.Select(field => field?.Type == IntermediateFieldType.Bool + var fields = typeLibSymbol.Fields.Select(field => field?.Type == IntermediateFieldType.Bool ? field.AsNullableNumber()?.ToString() : field?.AsString()) .ToList(); -- cgit v1.2.3-55-g6feb