diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-07 13:20:06 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-07 20:36:35 +1000 |
| commit | 79cd3cc53ab71329270c9e171d88cf475d3f7e23 (patch) | |
| tree | ad8cd9f74c4c6ae67e7e0f88241f6f845491c6e8 /src | |
| parent | 3c6ef1b305b97c2db4169e8a900fdd3178cf9d83 (diff) | |
| download | wix-79cd3cc53ab71329270c9e171d88cf475d3f7e23.tar.gz wix-79cd3cc53ab71329270c9e171d88cf475d3f7e23.tar.bz2 wix-79cd3cc53ab71329270c9e171d88cf475d3f7e23.zip | |
Add tests for the rest of the UI modes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs | 29 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs | 29 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs | 29 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl | 11 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs | 13 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.wxs | 12 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs | 29 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/TestData/data/example.txt (renamed from src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/example.txt) | 0 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/UIExtensionFixture.cs | 65 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj | 8 |
10 files changed, 192 insertions, 33 deletions
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs new file mode 100644 index 00000000..bbc54ac6 --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
| 10 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 11 | </Feature> | ||
| 12 | |||
| 13 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 14 | <Component> | ||
| 15 | <File Source="example.txt" /> | ||
| 16 | </Component> | ||
| 17 | </ComponentGroup> | ||
| 18 | |||
| 19 | <UIRef Id="WixUI_Advanced" /> | ||
| 20 | </Product> | ||
| 21 | |||
| 22 | <Fragment> | ||
| 23 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 24 | <Directory Id="ProgramFilesFolder"> | ||
| 25 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 26 | </Directory> | ||
| 27 | </Directory> | ||
| 28 | </Fragment> | ||
| 29 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs new file mode 100644 index 00000000..9f630f99 --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
| 10 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 11 | </Feature> | ||
| 12 | |||
| 13 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 14 | <Component> | ||
| 15 | <File Source="example.txt" /> | ||
| 16 | </Component> | ||
| 17 | </ComponentGroup> | ||
| 18 | |||
| 19 | <UIRef Id="WixUI_FeatureTree" /> | ||
| 20 | </Product> | ||
| 21 | |||
| 22 | <Fragment> | ||
| 23 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 24 | <Directory Id="ProgramFilesFolder"> | ||
| 25 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 26 | </Directory> | ||
| 27 | </Directory> | ||
| 28 | </Fragment> | ||
| 29 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs new file mode 100644 index 00000000..6239c7ab --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
| 10 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 11 | </Feature> | ||
| 12 | |||
| 13 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 14 | <Component> | ||
| 15 | <File Source="example.txt" /> | ||
| 16 | </Component> | ||
| 17 | </ComponentGroup> | ||
| 18 | |||
| 19 | <UIRef Id="WixUI_InstallDir" /> | ||
| 20 | </Product> | ||
| 21 | |||
| 22 | <Fragment> | ||
| 23 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 24 | <Directory Id="ProgramFilesFolder"> | ||
| 25 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 26 | </Directory> | ||
| 27 | </Directory> | ||
| 28 | </Fragment> | ||
| 29 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 9 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs index 68ff98fd..9f84785f 100644 --- a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs | |||
| @@ -3,13 +3,20 @@ | |||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> |
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> |
| 5 | 5 | ||
| 6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | 6 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> |
| 7 | <MediaTemplate /> | 7 | <MediaTemplate /> |
| 8 | 8 | ||
| 9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | 9 | <Feature Id="ProductFeature" Title="MsiPackage"> |
| 10 | <ComponentGroupRef Id="ProductComponents" /> | 10 | <ComponentGroupRef Id="ProductComponents" /> |
| 11 | </Feature> | 11 | </Feature> |
| 12 | 12 | ||
| 13 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 14 | <Component> | ||
| 15 | <File Source="example.txt" /> | ||
| 16 | </Component> | ||
| 17 | </ComponentGroup> | ||
| 18 | |||
| 19 | <UIRef Id="WixUI_Minimal" /> | ||
| 13 | </Product> | 20 | </Product> |
| 14 | 21 | ||
| 15 | <Fragment> | 22 | <Fragment> |
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.wxs deleted file mode 100644 index c50785a1..00000000 --- a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.wxs +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <UIRef Id="WixUI_Minimal" /> | ||
| 5 | |||
| 6 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 7 | <Component> | ||
| 8 | <File Source="example.txt" /> | ||
| 9 | </Component> | ||
| 10 | </ComponentGroup> | ||
| 11 | </Fragment> | ||
| 12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs new file mode 100644 index 00000000..a670cae9 --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
| 10 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 11 | </Feature> | ||
| 12 | |||
| 13 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 14 | <Component> | ||
| 15 | <File Source="example.txt" /> | ||
| 16 | </Component> | ||
| 17 | </ComponentGroup> | ||
| 18 | |||
| 19 | <UIRef Id="WixUI_Mondo" /> | ||
| 20 | </Product> | ||
| 21 | |||
| 22 | <Fragment> | ||
| 23 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 24 | <Directory Id="ProgramFilesFolder"> | ||
| 25 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 26 | </Directory> | ||
| 27 | </Directory> | ||
| 28 | </Fragment> | ||
| 29 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/example.txt b/src/test/WixToolsetTest.UI/TestData/data/example.txt index 1b4ffe8a..1b4ffe8a 100644 --- a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/example.txt +++ b/src/test/WixToolsetTest.UI/TestData/data/example.txt | |||
diff --git a/src/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/test/WixToolsetTest.UI/UIExtensionFixture.cs index 43694c49..09cc26f9 100644 --- a/src/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/test/WixToolsetTest.UI/UIExtensionFixture.cs | |||
| @@ -10,17 +10,74 @@ namespace WixToolsetTest.UI | |||
| 10 | 10 | ||
| 11 | public class UIExtensionFixture | 11 | public class UIExtensionFixture |
| 12 | { | 12 | { |
| 13 | [Fact(Skip = "Currently fails")] | 13 | [Fact(Skip = "WixUI_Advanced is missing because it can't currently compile in v4")] |
| 14 | public void CanBuildUsingWixUIAdvanced() | ||
| 15 | { | ||
| 16 | var folder = TestData.Get(@"TestData\WixUI_Advanced"); | ||
| 17 | var bindFolder = TestData.Get(@"TestData\data"); | ||
| 18 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 19 | |||
| 20 | var results = build.BuildAndQuery(Build, "Property"); | ||
| 21 | Assert.Equal(new[] | ||
| 22 | { | ||
| 23 | "Property:WixUI_Mode\tAdvanced", | ||
| 24 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | ||
| 25 | } | ||
| 26 | |||
| 27 | [Fact] | ||
| 28 | public void CanBuildUsingWixUIFeatureTree() | ||
| 29 | { | ||
| 30 | var folder = TestData.Get(@"TestData\WixUI_FeatureTree"); | ||
| 31 | var bindFolder = TestData.Get(@"TestData\data"); | ||
| 32 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 33 | |||
| 34 | var results = build.BuildAndQuery(Build, "Property"); | ||
| 35 | Assert.Equal(new[] | ||
| 36 | { | ||
| 37 | "Property:WixUI_Mode\tFeatureTree", | ||
| 38 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | ||
| 39 | } | ||
| 40 | |||
| 41 | [Fact] | ||
| 42 | public void CanBuildUsingWixUIInstallDir() | ||
| 43 | { | ||
| 44 | var folder = TestData.Get(@"TestData\WixUI_InstallDir"); | ||
| 45 | var bindFolder = TestData.Get(@"TestData\data"); | ||
| 46 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 47 | |||
| 48 | var results = build.BuildAndQuery(Build, "Property"); | ||
| 49 | Assert.Equal(new[] | ||
| 50 | { | ||
| 51 | "Property:WixUI_Mode\tInstallDir", | ||
| 52 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | ||
| 53 | } | ||
| 54 | |||
| 55 | [Fact] | ||
| 14 | public void CanBuildUsingWixUIMinimal() | 56 | public void CanBuildUsingWixUIMinimal() |
| 15 | { | 57 | { |
| 16 | var folder = TestData.Get(@"TestData\WixUI_Minimal"); | 58 | var folder = TestData.Get(@"TestData\WixUI_Minimal"); |
| 17 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { folder }); | 59 | var bindFolder = TestData.Get(@"TestData\data"); |
| 60 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 61 | |||
| 62 | var results = build.BuildAndQuery(Build, "Property"); | ||
| 63 | Assert.Equal(new[] | ||
| 64 | { | ||
| 65 | "Property:WixUI_Mode\tMinimal", | ||
| 66 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); | ||
| 67 | } | ||
| 68 | |||
| 69 | [Fact] | ||
| 70 | public void CanBuildUsingWixUIMondo() | ||
| 71 | { | ||
| 72 | var folder = TestData.Get(@"TestData\WixUI_Mondo"); | ||
| 73 | var bindFolder = TestData.Get(@"TestData\data"); | ||
| 74 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 18 | 75 | ||
| 19 | var results = build.BuildAndQuery(Build, "Property"); | 76 | var results = build.BuildAndQuery(Build, "Property"); |
| 20 | Assert.Equal(new[] | 77 | Assert.Equal(new[] |
| 21 | { | 78 | { |
| 22 | "Property:", | 79 | "Property:WixUI_Mode\tMondo", |
| 23 | }, results.OrderBy(s => s).ToArray()); | 80 | }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray()); |
| 24 | } | 81 | } |
| 25 | 82 | ||
| 26 | private static void Build(string[] args) | 83 | private static void Build(string[] args) |
diff --git a/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj b/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj index b5f58ea8..83f7bcb3 100644 --- a/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj +++ b/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj | |||
| @@ -12,10 +12,12 @@ | |||
| 12 | </PropertyGroup> | 12 | </PropertyGroup> |
| 13 | 13 | ||
| 14 | <ItemGroup> | 14 | <ItemGroup> |
| 15 | <Content Include="TestData\WixUI_Minimal\example.txt" CopyToOutputDirectory="PreserveNewest" /> | 15 | <Content Include="TestData\data\example.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 16 | <Content Include="TestData\WixUI_Minimal\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 16 | <Content Include="TestData\WixUI_Advanced\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 17 | <Content Include="TestData\WixUI_FeatureTree\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 18 | <Content Include="TestData\WixUI_InstallDir\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 17 | <Content Include="TestData\WixUI_Minimal\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 19 | <Content Include="TestData\WixUI_Minimal\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 18 | <Content Include="TestData\WixUI_Minimal\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 20 | <Content Include="TestData\WixUI_Mondo\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 19 | </ItemGroup> | 21 | </ItemGroup> |
| 20 | 22 | ||
| 21 | <ItemGroup> | 23 | <ItemGroup> |
