diff options
author | Rob Mensching <rob@firegiant.com> | 2017-12-29 03:57:03 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-12-29 03:57:03 -0800 |
commit | be163ecb92398a8d569a7e97aaf25bc7e5fb9eec (patch) | |
tree | d720b23f90a7e9667a4480e11e8aac506f9a8250 /src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |
parent | 58b8be53fd966e3d475362912477a422f5b5aa11 (diff) | |
download | wix-be163ecb92398a8d569a7e97aaf25bc7e5fb9eec.tar.gz wix-be163ecb92398a8d569a7e97aaf25bc7e5fb9eec.tar.bz2 wix-be163ecb92398a8d569a7e97aaf25bc7e5fb9eec.zip |
Move to WixBuildTools.TestSupport
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index 3714f9e7..5de61368 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
@@ -6,15 +6,28 @@ namespace WixToolsetTest.CoreIntegration | |||
6 | using System.IO; | 6 | using System.IO; |
7 | using System.Linq; | 7 | using System.Linq; |
8 | using Example.Extension; | 8 | using Example.Extension; |
9 | using WixBuildTools.TestSupport; | ||
9 | using WixToolset.Core; | 10 | using WixToolset.Core; |
10 | using WixToolset.Data; | 11 | using WixToolset.Data; |
11 | using WixToolset.Data.Tuples; | 12 | using WixToolset.Data.Tuples; |
12 | using WixToolsetTest.CoreIntegration.Utility; | ||
13 | using Xunit; | 13 | using Xunit; |
14 | 14 | ||
15 | public class ExtensionFixture | 15 | public class ExtensionFixture |
16 | { | 16 | { |
17 | [Fact] | 17 | [Fact] |
18 | public void CanBuildAndQuery() | ||
19 | { | ||
20 | var folder = TestData.Get(@"TestData\ExampleExtension"); | ||
21 | var build = new Builder(folder, typeof(ExampleExtensionFactory), new[] { Path.Combine(folder, "data") }); | ||
22 | |||
23 | var results = build.BuildAndQuery(Build, "Example"); | ||
24 | Assert.Equal(new[] | ||
25 | { | ||
26 | "Example:Foo\tBar" | ||
27 | }, results); | ||
28 | } | ||
29 | |||
30 | [Fact] | ||
18 | public void CanBuildWithExampleExtension() | 31 | public void CanBuildWithExampleExtension() |
19 | { | 32 | { |
20 | var folder = TestData.Get(@"TestData\ExampleExtension"); | 33 | var folder = TestData.Get(@"TestData\ExampleExtension"); |
@@ -83,21 +96,20 @@ namespace WixToolsetTest.CoreIntegration | |||
83 | 96 | ||
84 | Assert.Equal(0, result); | 97 | Assert.Equal(0, result); |
85 | 98 | ||
86 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\extest.msi"))); | ||
87 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\extest.wixpdb"))); | ||
88 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\example.txt"))); | ||
89 | |||
90 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\extest.wir")); | 99 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\extest.wir")); |
91 | var section = intermediate.Sections.Single(); | 100 | var section = intermediate.Sections.Single(); |
92 | 101 | ||
93 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
94 | Assert.Equal(Path.Combine(folder, @"data\example.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
95 | Assert.Equal(@"example.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
96 | |||
97 | var property = section.Tuples.OfType<PropertyTuple>().Where(p => p.Id.Id == "ExampleProperty").Single(); | 102 | var property = section.Tuples.OfType<PropertyTuple>().Where(p => p.Id.Id == "ExampleProperty").Single(); |
98 | Assert.Equal("ExampleProperty", property.Property); | 103 | Assert.Equal("ExampleProperty", property.Property); |
99 | Assert.Equal("test", property.Value); | 104 | Assert.Equal("test", property.Value); |
100 | } | 105 | } |
101 | } | 106 | } |
107 | |||
108 | private static void Build(string[] args) | ||
109 | { | ||
110 | var program = new Program(); | ||
111 | var result = program.Run(new WixToolsetServiceProvider(), null, args); | ||
112 | Assert.Equal(0, result); | ||
113 | } | ||
102 | } | 114 | } |
103 | } | 115 | } |