diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-29 22:11:32 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-29 22:11:32 -0800 |
| commit | b387913d0e76aa7863f8766868cd2fb3b3fffcde (patch) | |
| tree | 489c84a68c6a2932efe99def3ebc81e926d07a36 /src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs | |
| parent | 71c52d5af2293d3eb79882ce36b0411f81185c11 (diff) | |
| download | wix-b387913d0e76aa7863f8766868cd2fb3b3fffcde.tar.gz wix-b387913d0e76aa7863f8766868cd2fb3b3fffcde.tar.bz2 wix-b387913d0e76aa7863f8766868cd2fb3b3fffcde.zip | |
Remove "Fixture" from the test assembly name
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs new file mode 100644 index 00000000..9859c05a --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs | |||
| @@ -0,0 +1,90 @@ | |||
| 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.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using System.Linq; | ||
| 7 | using WixToolset.Core; | ||
| 8 | using WixToolset.Data; | ||
| 9 | using WixToolset.Data.Tuples; | ||
| 10 | using WixToolsetTest.CoreIntegration.Utility; | ||
| 11 | using Xunit; | ||
| 12 | |||
| 13 | public class ProgramFixture | ||
| 14 | { | ||
| 15 | [Fact] | ||
| 16 | public void CanBuildSingleFile() | ||
| 17 | { | ||
| 18 | var folder = TestData.Get(@"TestData\SingleFile"); | ||
| 19 | |||
| 20 | using (var fs = new DisposableFileSystem()) | ||
| 21 | using (var pushd = new Pushd(folder)) | ||
| 22 | { | ||
| 23 | var intermediateFolder = fs.GetFolder(); | ||
| 24 | |||
| 25 | var program = new Program(); | ||
| 26 | var result = program.Run(new WixToolsetServiceProvider(), new[] { "build", "Package.wxs", "PackageComponents.wxs", "-loc", "Package.en-us.wxl", "-bindpath", "data", "-intermediateFolder", intermediateFolder, "-o", $@"{intermediateFolder}\bin\test.msi" }); | ||
| 27 | |||
| 28 | Assert.Equal(0, result); | ||
| 29 | |||
| 30 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.msi"))); | ||
| 31 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.wixpdb"))); | ||
| 32 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\test.txt"))); | ||
| 33 | |||
| 34 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wir")); | ||
| 35 | Assert.Single(intermediate.Sections); | ||
| 36 | |||
| 37 | var wixFile = intermediate.Sections.SelectMany(s => s.Tuples).OfType<WixFileTuple>().Single(); | ||
| 38 | Assert.Equal(@"data\test.txt", wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 39 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | [Fact] | ||
| 44 | public void CanBuildSimpleModule() | ||
| 45 | { | ||
| 46 | var folder = TestData.Get(@"TestData\SimpleModule"); | ||
| 47 | |||
| 48 | using (var fs = new DisposableFileSystem()) | ||
| 49 | using (var pushd = new Pushd(folder)) | ||
| 50 | { | ||
| 51 | var intermediateFolder = fs.GetFolder(); | ||
| 52 | |||
| 53 | var program = new Program(); | ||
| 54 | var result = program.Run(new WixToolsetServiceProvider(), new[] { "build", "Module.wxs", "-loc", "Module.en-us.wxl", "-bindpath", "data", "-intermediateFolder", intermediateFolder, "-o", $@"{intermediateFolder}\bin\test.msm" }); | ||
| 55 | |||
| 56 | Assert.Equal(0, result); | ||
| 57 | |||
| 58 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.msm"))); | ||
| 59 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.wixpdb"))); | ||
| 60 | |||
| 61 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wir")); | ||
| 62 | Assert.Single(intermediate.Sections); | ||
| 63 | |||
| 64 | var wixFile = intermediate.Sections.SelectMany(s => s.Tuples).OfType<WixFileTuple>().Single(); | ||
| 65 | Assert.Equal(@"data\test.txt", wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 66 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | [Fact(Skip = "Not implemented yet.")] | ||
| 71 | public void CanBuildInstanceTransform() | ||
| 72 | { | ||
| 73 | var folder = TestData.Get(@"TestData\InstanceTransform"); | ||
| 74 | |||
| 75 | using (var fs = new DisposableFileSystem()) | ||
| 76 | using (var pushd = new Pushd(folder)) | ||
| 77 | { | ||
| 78 | var intermediateFolder = fs.GetFolder(); | ||
| 79 | |||
| 80 | var program = new Program(); | ||
| 81 | var result = program.Run(new WixToolsetServiceProvider(), new[] { "build", "Package.wxs", "PackageComponents.wxs", "-loc", "Package.en-us.wxl", "-bindpath", "data", "-intermediateFolder", intermediateFolder, "-o", $@"{intermediateFolder}\bin\test.msi" }); | ||
| 82 | |||
| 83 | Assert.Equal(0, result); | ||
| 84 | |||
| 85 | var pdb = Pdb.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb"), false); | ||
| 86 | Assert.NotEmpty(pdb.Output.SubStorages); | ||
| 87 | } | ||
| 88 | } | ||
| 89 | } | ||
| 90 | } | ||
