diff options
Diffstat (limited to 'src/tools/test/WixToolsetTest.Heat/DirectoryToPayloadGroupFixture.cs')
-rw-r--r-- | src/tools/test/WixToolsetTest.Heat/DirectoryToPayloadGroupFixture.cs | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/src/tools/test/WixToolsetTest.Heat/DirectoryToPayloadGroupFixture.cs b/src/tools/test/WixToolsetTest.Heat/DirectoryToPayloadGroupFixture.cs deleted file mode 100644 index db71c4cd..00000000 --- a/src/tools/test/WixToolsetTest.Heat/DirectoryToPayloadGroupFixture.cs +++ /dev/null | |||
@@ -1,115 +0,0 @@ | |||
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.Heat | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | using System.Linq; | ||
8 | using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
9 | using WixInternal.MSTestSupport; | ||
10 | |||
11 | [TestClass] | ||
12 | public class DirectoryToPayloadGroupFixture | ||
13 | { | ||
14 | [TestMethod] | ||
15 | public void CanHarvestSimpleDirectory() | ||
16 | { | ||
17 | var folder = TestData.Get("TestData", "SingleFile"); | ||
18 | |||
19 | using (var fs = new DisposableFileSystem()) | ||
20 | { | ||
21 | var outputPath = Path.Combine(fs.GetFolder(), "out.wxs"); | ||
22 | |||
23 | var args = new[] | ||
24 | { | ||
25 | "dir", folder, | ||
26 | "-generate", "payloadgroup", | ||
27 | "-o", outputPath | ||
28 | }; | ||
29 | |||
30 | var result = HeatRunner.Execute(args); | ||
31 | result.AssertSuccess(); | ||
32 | |||
33 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | ||
34 | WixAssert.CompareLineByLine(new[] | ||
35 | { | ||
36 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
37 | " <Fragment>", | ||
38 | " <PayloadGroup Id='TARGETDIR'>", | ||
39 | " <Payload SourceFile='SourceDir\\a.txt' />", | ||
40 | " </PayloadGroup>", | ||
41 | " </Fragment>", | ||
42 | "</Wix>", | ||
43 | }, wxs); | ||
44 | } | ||
45 | } | ||
46 | |||
47 | [TestMethod] | ||
48 | public void CanHarvestSimpleDirectoryWithSourceDirSubstitution() | ||
49 | { | ||
50 | var folder = TestData.Get("TestData", "SingleFile"); | ||
51 | |||
52 | using (var fs = new DisposableFileSystem()) | ||
53 | { | ||
54 | var outputPath = Path.Combine(fs.GetFolder(), "out.wxs"); | ||
55 | |||
56 | var args = new[] | ||
57 | { | ||
58 | "dir", folder, | ||
59 | "-generate", "payloadgroup", | ||
60 | "-var", "var.RootDir", | ||
61 | "-o", outputPath | ||
62 | }; | ||
63 | |||
64 | var result = HeatRunner.Execute(args); | ||
65 | result.AssertSuccess(); | ||
66 | |||
67 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | ||
68 | WixAssert.CompareLineByLine(new[] | ||
69 | { | ||
70 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
71 | " <Fragment>", | ||
72 | " <PayloadGroup Id='TARGETDIR'>", | ||
73 | " <Payload SourceFile='$(var.RootDir)\\a.txt' />", | ||
74 | " </PayloadGroup>", | ||
75 | " </Fragment>", | ||
76 | "</Wix>", | ||
77 | }, wxs); | ||
78 | } | ||
79 | } | ||
80 | |||
81 | [TestMethod] | ||
82 | public void CanHarvestNestedFiles() | ||
83 | { | ||
84 | var folder = TestData.Get("TestData", "NestedFiles"); | ||
85 | |||
86 | using (var fs = new DisposableFileSystem()) | ||
87 | { | ||
88 | var outputPath = Path.Combine(fs.GetFolder(), "out.wxs"); | ||
89 | |||
90 | var args = new[] | ||
91 | { | ||
92 | "dir", folder, | ||
93 | "-generate", "payloadgroup", | ||
94 | "-o", outputPath | ||
95 | }; | ||
96 | |||
97 | var result = HeatRunner.Execute(args); | ||
98 | result.AssertSuccess(); | ||
99 | |||
100 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | ||
101 | WixAssert.CompareLineByLine(new[] | ||
102 | { | ||
103 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
104 | " <Fragment>", | ||
105 | " <PayloadGroup Id='TARGETDIR'>", | ||
106 | " <Payload SourceFile='SourceDir\\Nested\\c.txt' Name='Nested\\c.txt' />", | ||
107 | " <Payload SourceFile='SourceDir\\b.txt' />", | ||
108 | " </PayloadGroup>", | ||
109 | " </Fragment>", | ||
110 | "</Wix>", | ||
111 | }, wxs); | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | } | ||