| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 2 | |
| 3 | namespace WixToolsetTest.CoreIntegration |
| 4 | { |
| 5 | using System.Linq; |
| 6 | using WixToolset.Core; |
| 7 | using WixToolset.Data; |
| 8 | using WixToolset.Data.Symbols; |
| 9 | using WixToolset.Extensibility.Data; |
| 10 | using WixToolset.Extensibility.Services; |
| 11 | using Xunit; |
| 12 | |
| 13 | public class ParseFixture |
| 14 | { |
| 15 | [Fact] |
| 16 | public void GeneratesCorrectCustomActionIdentifiers() |
| 17 | { |
| 18 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); |
| 19 | var section = new IntermediateSection("section", SectionType.Fragment); |
| 20 | var parseHelper = serviceProvider.GetService<IParseHelper>(); |
| 21 | |
| 22 | parseHelper.CreateCustomActionReference(null, section, "CustomAction32", Platform.X86, CustomActionPlatforms.X86); |
| 23 | parseHelper.CreateCustomActionReference(null, section, "CustomArmAction", Platform.ARM64, CustomActionPlatforms.X86); |
| 24 | parseHelper.CreateCustomActionReference(null, section, "CustomArmAction", Platform.ARM64, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64); |
| 25 | parseHelper.CreateCustomActionReference(null, section, "CustomAction", Platform.X64, CustomActionPlatforms.X86); |
| 26 | parseHelper.CreateCustomActionReference(null, section, "CustomAction", Platform.X64, CustomActionPlatforms.X86 | CustomActionPlatforms.X64); |
| 27 | |
| 28 | var simpleReferences = section.Symbols.OfType<WixSimpleReferenceSymbol>(); |
| 29 | Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:CustomAction32_X86").FirstOrDefault()); |
| 30 | Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:CustomArmAction_X86").FirstOrDefault()); |
| 31 | Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:CustomArmAction_A64").FirstOrDefault()); |
| 32 | Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:CustomAction_X86").FirstOrDefault()); |
| 33 | Assert.NotNull(simpleReferences.Where(t => t.SymbolicName == "CustomAction:CustomAction_X64").FirstOrDefault()); |
| 34 | } |
| 35 | } |
| 36 | } |