diff options
| author | Bob Arnson <bob@firegiant.com> | 2019-05-14 14:19:34 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2019-05-14 16:07:39 -0400 |
| commit | 44fb31d655bc5860d45e3acd4cd0cbfaaf5f12eb (patch) | |
| tree | c522b10288ceacf89ae3febc692ba92f27a6b2d7 /src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |
| parent | 83b04241472fdc93b0a3a7511479a1182ad5f4c0 (diff) | |
| download | wix-44fb31d655bc5860d45e3acd4cd0cbfaaf5f12eb.tar.gz wix-44fb31d655bc5860d45e3acd4cd0cbfaaf5f12eb.tar.bz2 wix-44fb31d655bc5860d45e3acd4cd0cbfaaf5f12eb.zip | |
Add Component/@Shared and fix UninstallWhenSuperseded
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index 3e66ad0a..0aabc5a9 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
| @@ -43,7 +43,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 43 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | 43 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); |
| 44 | var section = intermediate.Sections.Single(); | 44 | var section = intermediate.Sections.Single(); |
| 45 | 45 | ||
| 46 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | 46 | var wixFile = section.Tuples.OfType<WixFileTuple>().First(); |
| 47 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | 47 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); |
| 48 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | 48 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); |
| 49 | } | 49 | } |
| @@ -540,6 +540,43 @@ namespace WixToolsetTest.CoreIntegration | |||
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | [Fact] | 542 | [Fact] |
| 543 | public void CanBuildSharedComponent() | ||
| 544 | { | ||
| 545 | var folder = TestData.Get(@"TestData\SingleFile"); | ||
| 546 | |||
| 547 | using (var fs = new DisposableFileSystem()) | ||
| 548 | { | ||
| 549 | var baseFolder = fs.GetFolder(); | ||
| 550 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 551 | |||
| 552 | var result = WixRunner.Execute(new[] | ||
| 553 | { | ||
| 554 | "build", | ||
| 555 | Path.Combine(folder, "Package.wxs"), | ||
| 556 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 557 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 558 | "-bindpath", Path.Combine(folder, "data"), | ||
| 559 | "-intermediateFolder", intermediateFolder, | ||
| 560 | "-arch", "x64", | ||
| 561 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 562 | }); | ||
| 563 | |||
| 564 | result.AssertSuccess(); | ||
| 565 | |||
| 566 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | ||
| 567 | var section = intermediate.Sections.Single(); | ||
| 568 | |||
| 569 | // Only one component is shared. | ||
| 570 | var sharedComponentTuples = section.Tuples.OfType<ComponentTuple>(); | ||
| 571 | Assert.Equal(1, sharedComponentTuples.Sum(t => t.Shared ? 1 : 0)); | ||
| 572 | |||
| 573 | // And it is this one. | ||
| 574 | var sharedComponentTuple = sharedComponentTuples.Single(t => t.Id.Id == "Shared.dll"); | ||
| 575 | Assert.True(sharedComponentTuple.Shared); | ||
| 576 | } | ||
| 577 | } | ||
| 578 | |||
| 579 | [Fact] | ||
| 543 | public void CanBuildSetProperty() | 580 | public void CanBuildSetProperty() |
| 544 | { | 581 | { |
| 545 | var folder = TestData.Get(@"TestData\SetProperty"); | 582 | var folder = TestData.Get(@"TestData\SetProperty"); |
