diff options
Diffstat (limited to 'src/ext/Util/test')
3 files changed, 32 insertions, 7 deletions
diff --git a/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/Package.wxs b/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/Package.wxs index a2002634..cb132960 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/Package.wxs +++ b/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/Package.wxs | |||
@@ -1,17 +1,27 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> |
2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> |
3 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | 3 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> |
4 | 4 | ||
5 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | 5 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> |
6 | <Component Directory="INSTALLFOLDER"> | ||
7 | <File Id="MyXmlFile" Source="my.xml" /> | ||
8 | </Component> | ||
9 | |||
6 | <Component Id="Del" Directory="INSTALLFOLDER" Guid="3613414c-11f5-40fa-a1f1-a0ba722a6895"> | 10 | <Component Id="Del" Directory="INSTALLFOLDER" Guid="3613414c-11f5-40fa-a1f1-a0ba722a6895"> |
7 | <util:XmlConfig Id="DelElement" File="[INSTALLFOLDER]my.xml" Action="delete" Node="element" VerifyPath="xxx" ElementPath="//root/sub" On="install" Sequence="1" /> | 11 | <util:XmlConfig Id="DelElement" File="[#MyXmlFile]" Action="delete" Node="element" VerifyPath="grandchild1" ElementPath="//root/child1" On="install" /> |
12 | </Component> | ||
13 | |||
14 | <Component Id="Add" Directory="INSTALLFOLDER" Guid="30A9FF8B-7AC8-47F3-BB24-9EA81AA38856"> | ||
15 | <util:XmlConfig Id="AddElement" File="[#MyXmlFile]" Action="create" Node="element" ElementPath="//root/child2" Name="grandchild3" On="install" Sequence="2" /> | ||
16 | <util:XmlConfig ElementId="AddElement" File="[#MyXmlFile]" Name="TheAttribute1" Value="AttributeValue1" Sequence="3" /> | ||
17 | <util:XmlConfig Id="AddAttribute2" ElementId="AddElement" File="[INSTALLFOLDER]my.xml" Name="TheAttribute2" Value="AttributeValue2" Sequence="4" /> | ||
8 | </Component> | 18 | </Component> |
9 | </Feature> | 19 | </Feature> |
10 | </Package> | 20 | </Package> |
11 | 21 | ||
12 | <Fragment> | 22 | <Fragment> |
13 | <StandardDirectory Id="ProgramFilesFolder"> | 23 | <StandardDirectory Id="ProgramFilesFolder"> |
14 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | 24 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> |
15 | </StandardDirectory> | 25 | </StandardDirectory> |
16 | </Fragment> | 26 | </Fragment> |
17 | </Wix> | 27 | </Wix> |
diff --git a/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/my.xml b/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/my.xml new file mode 100644 index 00000000..3f44c27c --- /dev/null +++ b/src/ext/Util/test/WixToolsetTest.Util/TestData/XmlConfig/my.xml | |||
@@ -0,0 +1,11 @@ | |||
1 | <root> | ||
2 | <child1> | ||
3 | <grandchild1> | ||
4 | </grandchild1> | ||
5 | </child1> | ||
6 | |||
7 | <child2> | ||
8 | <grandchild2> | ||
9 | </grandchild2> | ||
10 | </child2> | ||
11 | </root> | ||
diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 817ab7c9..e04252da 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
@@ -10,6 +10,7 @@ namespace WixToolsetTest.Util | |||
10 | using WixToolset.Util; | 10 | using WixToolset.Util; |
11 | using Xunit; | 11 | using Xunit; |
12 | using System.Xml.Linq; | 12 | using System.Xml.Linq; |
13 | using System; | ||
13 | 14 | ||
14 | public class UtilExtensionFixture | 15 | public class UtilExtensionFixture |
15 | { | 16 | { |
@@ -293,7 +294,10 @@ namespace WixToolsetTest.Util | |||
293 | var results = build.BuildAndQuery(BuildX64, "Wix4XmlConfig"); | 294 | var results = build.BuildAndQuery(BuildX64, "Wix4XmlConfig"); |
294 | WixAssert.CompareLineByLine(new[] | 295 | WixAssert.CompareLineByLine(new[] |
295 | { | 296 | { |
296 | "Wix4XmlConfig:DelElement\t[INSTALLFOLDER]my.xml\t\t//root/sub\txxx\t\t\t289\tDel\t1", | 297 | "Wix4XmlConfig:AddAttribute2\t[INSTALLFOLDER]my.xml\tAddElement\t\t\tTheAttribute2\tAttributeValue2\t0\tAdd\t4", |
298 | "Wix4XmlConfig:AddElement\t[#MyXmlFile]\t\t//root/child2\t\tgrandchild3\t\t273\tAdd\t2", | ||
299 | "Wix4XmlConfig:DelElement\t[#MyXmlFile]\t\t//root/child1\tgrandchild1\t\t\t289\tDel\t", | ||
300 | "Wix4XmlConfig:uxcPPF6g4HJEQpBLT9w9GT6SKyHWww\t[#MyXmlFile]\tAddElement\t\t\tTheAttribute1\tAttributeValue1\t0\tAdd\t3", | ||
297 | }, results.OrderBy(s => s).ToArray()); | 301 | }, results.OrderBy(s => s).ToArray()); |
298 | } | 302 | } |
299 | 303 | ||