diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-01-08 15:33:32 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-01-08 15:53:40 -0800 |
| commit | 2accc355d9dadb2688cf226f8736232d583281aa (patch) | |
| tree | 334c1174fb09b8e4ece67724d48ef9b551d7cfba /src/test | |
| parent | 0f51c342c84d291fcb1c7cbde3a1613edbda300a (diff) | |
| download | wix-2accc355d9dadb2688cf226f8736232d583281aa.tar.gz wix-2accc355d9dadb2688cf226f8736232d583281aa.tar.bz2 wix-2accc355d9dadb2688cf226f8736232d583281aa.zip | |
Rename ExePackage/@XxxCommand attributes to @XxxArguments
Fixes wixtoolset/issues#6245
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/ExePackageFixture.cs | 49 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj | 4 |
2 files changed, 51 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.Converters/ExePackageFixture.cs b/src/test/WixToolsetTest.Converters/ExePackageFixture.cs new file mode 100644 index 00000000..0ee8d065 --- /dev/null +++ b/src/test/WixToolsetTest.Converters/ExePackageFixture.cs | |||
| @@ -0,0 +1,49 @@ | |||
| 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.Converters | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Xml.Linq; | ||
| 7 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Converters; | ||
| 9 | using WixToolsetTest.Converters.Mocks; | ||
| 10 | using Xunit; | ||
| 11 | |||
| 12 | public class ExePackageFixture : BaseConverterFixture | ||
| 13 | { | ||
| 14 | [Fact] | ||
| 15 | public void CanConvertExePackageCommandToArguments() | ||
| 16 | { | ||
| 17 | var parse = String.Join(Environment.NewLine, | ||
| 18 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
| 19 | " <Fragment>", | ||
| 20 | " <PackageGroup Id='exe'>", | ||
| 21 | " <ExePackage InstallCommand='-install' RepairCommand='-repair' UninstallCommand='-uninstall' SourceFile='test.exe' />", | ||
| 22 | " </PackageGroup>", | ||
| 23 | " </Fragment>", | ||
| 24 | "</Wix>"); | ||
| 25 | |||
| 26 | var expected = new[] | ||
| 27 | { | ||
| 28 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 29 | " <Fragment>", | ||
| 30 | " <PackageGroup Id=\"exe\">", | ||
| 31 | " <ExePackage SourceFile=\"test.exe\" InstallArguments=\"-install\" RepairArguments=\"-repair\" UninstallArguments=\"-uninstall\" />", | ||
| 32 | " </PackageGroup>", | ||
| 33 | " </Fragment>", | ||
| 34 | "</Wix>" | ||
| 35 | }; | ||
| 36 | |||
| 37 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 38 | |||
| 39 | var messaging = new MockMessaging(); | ||
| 40 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 41 | |||
| 42 | var errors = converter.ConvertDocument(document); | ||
| 43 | Assert.Equal(3, errors); | ||
| 44 | |||
| 45 | var actualLines = UnformattedDocumentLines(document); | ||
| 46 | WixAssert.CompareLineByLine(expected, actualLines); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | } | ||
diff --git a/src/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj b/src/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj index 1bf44dbc..902494a2 100644 --- a/src/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj +++ b/src/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj | |||
| @@ -36,8 +36,8 @@ | |||
| 36 | </ItemGroup> | 36 | </ItemGroup> |
| 37 | 37 | ||
| 38 | <ItemGroup> | 38 | <ItemGroup> |
| 39 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" /> | 39 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> |
| 40 | <PackageReference Include="xunit" Version="2.4.1" /> | 40 | <PackageReference Include="xunit" Version="2.4.1" /> |
| 41 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" /> | 41 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="All" /> |
| 42 | </ItemGroup> | 42 | </ItemGroup> |
| 43 | </Project> | 43 | </Project> |
