diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs new file mode 100644 index 00000000..c6fa602b --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs | |||
| @@ -0,0 +1,48 @@ | |||
| 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 WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Core.TestPackage; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using WixToolset.Data.Symbols; | ||
| 11 | using Xunit; | ||
| 12 | |||
| 13 | public class CopyFileFixture | ||
| 14 | { | ||
| 15 | [Fact] | ||
| 16 | public void CanBuildCopyFile() | ||
| 17 | { | ||
| 18 | var folder = TestData.Get(@"TestData"); | ||
| 19 | |||
| 20 | using (var fs = new DisposableFileSystem()) | ||
| 21 | { | ||
| 22 | var baseFolder = fs.GetFolder(); | ||
| 23 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 24 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 25 | |||
| 26 | var result = WixRunner.Execute(new[] | ||
| 27 | { | ||
| 28 | "build", | ||
| 29 | Path.Combine(folder, "CopyFile", "CopyFile.wxs"), | ||
| 30 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 31 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 32 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 33 | "-intermediateFolder", intermediateFolder, | ||
| 34 | "-o", msiPath | ||
| 35 | }); | ||
| 36 | |||
| 37 | result.AssertSuccess(); | ||
| 38 | |||
| 39 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | ||
| 40 | var section = intermediate.Sections.Single(); | ||
| 41 | var copyFileSymbol = section.Symbols.OfType<MoveFileSymbol>().Single(); | ||
| 42 | Assert.Equal("MoveText", copyFileSymbol.Id.Id); | ||
| 43 | Assert.True(copyFileSymbol.Delete); | ||
| 44 | Assert.Equal("OtherFolder", copyFileSymbol.DestFolder); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } | ||
