diff options
author | Rob Mensching <rob@firegiant.com> | 2021-05-04 22:48:12 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-05-04 22:48:12 -0700 |
commit | 7c8e34de56b3348c5a421cd0cced183e1394c5c7 (patch) | |
tree | c2f17867b49e33e0833eae2e1841a00b009c1a15 /src/ext/Iis/test | |
parent | c5c87377d99beefe83a3470aab326d12bdf0f8a4 (diff) | |
download | wix-7c8e34de56b3348c5a421cd0cced183e1394c5c7.tar.gz wix-7c8e34de56b3348c5a421cd0cced183e1394c5c7.tar.bz2 wix-7c8e34de56b3348c5a421cd0cced183e1394c5c7.zip |
Move Iis.wixext into ext
Diffstat (limited to 'src/ext/Iis/test')
7 files changed, 123 insertions, 0 deletions
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs new file mode 100644 index 00000000..685e7126 --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs | |||
@@ -0,0 +1,32 @@ | |||
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.Iis | ||
4 | { | ||
5 | using System.Linq; | ||
6 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Core.TestPackage; | ||
8 | using WixToolset.Iis; | ||
9 | using Xunit; | ||
10 | |||
11 | public class IisExtensionFixture | ||
12 | { | ||
13 | [Fact] | ||
14 | public void CanBuildUsingIIsWebAddress() | ||
15 | { | ||
16 | var folder = TestData.Get(@"TestData\UsingIis"); | ||
17 | var build = new Builder(folder, typeof(IisExtensionFactory), new[] { folder }); | ||
18 | |||
19 | var results = build.BuildAndQuery(Build, "IIsWebAddress"); | ||
20 | Assert.Equal(new[] | ||
21 | { | ||
22 | "IIsWebAddress:TestAddress\tTest\t\t[PORT]\t\t0", | ||
23 | }, results); | ||
24 | } | ||
25 | |||
26 | private static void Build(string[] args) | ||
27 | { | ||
28 | var result = WixRunner.Execute(args) | ||
29 | .AssertSuccess(); | ||
30 | } | ||
31 | } | ||
32 | } | ||
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.en-us.wxl b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.en-us.wxl | |||
@@ -0,0 +1,11 @@ | |||
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/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.wxs b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.wxs new file mode 100644 index 00000000..f36aafef --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/Package.wxs | |||
@@ -0,0 +1,17 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> | ||
3 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
4 | |||
5 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
6 | <ComponentGroupRef Id="ProductComponents" /> | ||
7 | </Feature> | ||
8 | </Package> | ||
9 | |||
10 | <Fragment> | ||
11 | <StandardDirectory Id="ProgramFilesFolder"> | ||
12 | <Directory Id="INSTALLFOLDER" Name="MsiPackage"> | ||
13 | <Directory Id="TestWebSiteProductDirectory" /> | ||
14 | </Directory> | ||
15 | </StandardDirectory> | ||
16 | </Fragment> | ||
17 | </Wix> | ||
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/PackageComponents.wxs b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/PackageComponents.wxs new file mode 100644 index 00000000..03203b50 --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/PackageComponents.wxs | |||
@@ -0,0 +1,16 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
3 | xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis"> | ||
4 | <Fragment> | ||
5 | <Property Id="PORT" Value="3062" /> | ||
6 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
7 | <Component> | ||
8 | <File Source="example.txt" /> | ||
9 | <iis:WebSite Id="Test" Description="Test web server" Directory="TestWebSiteProductDirectory" AutoStart="yes" DirProperties="ReadAndExecute" ConfigureIfExists="no" > | ||
10 | <iis:WebAddress Id="TestAddress" Port="[PORT]" Secure="no" /> | ||
11 | </iis:WebSite> | ||
12 | </Component> | ||
13 | </ComponentGroup> | ||
14 | <iis:WebDirProperties Id="ReadAndExecute" /> | ||
15 | </Fragment> | ||
16 | </Wix> | ||
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/example.txt b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/TestData/UsingIis/example.txt | |||
@@ -0,0 +1 @@ | |||
This is example.txt. \ No newline at end of file | |||
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj new file mode 100644 index 00000000..49ed89bc --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj | |||
@@ -0,0 +1,41 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- 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. --> | ||
3 | |||
4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
5 | <PropertyGroup> | ||
6 | <TargetFramework>netcoreapp3.1</TargetFramework> | ||
7 | <IsPackable>false</IsPackable> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <PropertyGroup> | ||
11 | <NoWarn>NU1701</NoWarn> | ||
12 | </PropertyGroup> | ||
13 | |||
14 | <ItemGroup> | ||
15 | <Content Include="TestData\UsingIis\example.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
16 | <Content Include="TestData\UsingIis\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
17 | <Content Include="TestData\UsingIis\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
18 | <Content Include="TestData\UsingIis\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
19 | </ItemGroup> | ||
20 | |||
21 | <ItemGroup> | ||
22 | <ProjectReference Include="..\..\wixext\WixToolset.Iis.wixext.csproj" /> | ||
23 | </ItemGroup> | ||
24 | |||
25 | <ItemGroup> | ||
26 | <PackageReference Include="WixToolset.Core" Version="4.0.*" /> | ||
27 | <PackageReference Include="WixToolset.Core.Burn" Version="4.0.*" /> | ||
28 | <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" /> | ||
29 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" /> | ||
30 | </ItemGroup> | ||
31 | |||
32 | <ItemGroup> | ||
33 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
34 | </ItemGroup> | ||
35 | |||
36 | <ItemGroup> | ||
37 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" /> | ||
38 | <PackageReference Include="xunit" Version="2.4.1" /> | ||
39 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" /> | ||
40 | </ItemGroup> | ||
41 | </Project> | ||
diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.v3.ncrunchproject b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.v3.ncrunchproject new file mode 100644 index 00000000..7b5b2139 --- /dev/null +++ b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.v3.ncrunchproject | |||
@@ -0,0 +1,5 @@ | |||
1 | <ProjectConfiguration> | ||
2 | <Settings> | ||
3 | <CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace> | ||
4 | </Settings> | ||
5 | </ProjectConfiguration> \ No newline at end of file | ||