diff options
Diffstat (limited to 'src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs deleted file mode 100644 index a27928d5..00000000 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ /dev/null | |||
@@ -1,64 +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.BuildTasks | ||
4 | { | ||
5 | using System.IO; | ||
6 | using System.Linq; | ||
7 | using Microsoft.Build.Utilities; | ||
8 | using WixBuildTools.TestSupport; | ||
9 | using WixToolset.BuildTasks; | ||
10 | using WixToolset.Data; | ||
11 | using WixToolset.Data.Tuples; | ||
12 | using Xunit; | ||
13 | |||
14 | public partial class MsbuildFixture | ||
15 | { | ||
16 | [Fact] | ||
17 | public void CanBuildSimpleMsiPackage() | ||
18 | { | ||
19 | var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); | ||
20 | |||
21 | using (var fs = new DisposableFileSystem()) | ||
22 | { | ||
23 | var baseFolder = fs.GetFolder(); | ||
24 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
25 | |||
26 | var engine = new FakeBuildEngine(); | ||
27 | |||
28 | var task = new DoIt | ||
29 | { | ||
30 | BuildEngine = engine, | ||
31 | SourceFiles = new[] | ||
32 | { | ||
33 | new TaskItem(Path.Combine(folder, "Package.wxs")), | ||
34 | new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), | ||
35 | }, | ||
36 | LocalizationFiles = new[] | ||
37 | { | ||
38 | new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), | ||
39 | }, | ||
40 | BindInputPaths = new[] | ||
41 | { | ||
42 | new TaskItem(Path.Combine(folder, "data")), | ||
43 | }, | ||
44 | IntermediateDirectory = new TaskItem(intermediateFolder), | ||
45 | OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), | ||
46 | }; | ||
47 | |||
48 | var result = task.Execute(); | ||
49 | Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); | ||
50 | |||
51 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
52 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
53 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); | ||
54 | |||
55 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); | ||
56 | var section = intermediate.Sections.Single(); | ||
57 | |||
58 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
59 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
60 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | } | ||