diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-03 02:19:16 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-03 02:23:16 -0700 |
| commit | 9317f7c8ea709da55e4602eaaba06952bbf315b7 (patch) | |
| tree | 51e8348f891041dcc160a6b79e8965ca6a908b9d /src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |
| parent | d529525a1e331f3ef9ec2707791c99bd78fdd82f (diff) | |
| download | wix-9317f7c8ea709da55e4602eaaba06952bbf315b7.tar.gz wix-9317f7c8ea709da55e4602eaaba06952bbf315b7.tar.bz2 wix-9317f7c8ea709da55e4602eaaba06952bbf315b7.zip | |
Redesign CustomTable tuples to support resolving binary columns
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index aa8a0a0d..78a8f0a4 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -473,6 +473,121 @@ namespace WixToolsetTest.CoreIntegration | |||
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | [Fact] | 475 | [Fact] |
| 476 | public void PopulatesCustomTableWithLocalization() | ||
| 477 | { | ||
| 478 | var folder = TestData.Get(@"TestData"); | ||
| 479 | |||
| 480 | using (var fs = new DisposableFileSystem()) | ||
| 481 | { | ||
| 482 | var baseFolder = fs.GetFolder(); | ||
| 483 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 484 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 485 | |||
| 486 | var result = WixRunner.Execute(new[] | ||
| 487 | { | ||
| 488 | "build", | ||
| 489 | Path.Combine(folder, "CustomTable", "LocalizedCustomTable.wxs"), | ||
| 490 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 491 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 492 | "-loc", Path.Combine(folder, "CustomTable", "LocalizedCustomTable.en-us.wxl"), | ||
| 493 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 494 | "-intermediateFolder", intermediateFolder, | ||
| 495 | "-o", msiPath | ||
| 496 | }); | ||
| 497 | |||
| 498 | result.AssertSuccess(); | ||
| 499 | |||
| 500 | Assert.True(File.Exists(msiPath)); | ||
| 501 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableLocalized" }); | ||
| 502 | Assert.Equal(new[] | ||
| 503 | { | ||
| 504 | "CustomTableLocalized:Row1\tThis is row one", | ||
| 505 | "CustomTableLocalized:Row2\tThis is row two", | ||
| 506 | }, results); | ||
| 507 | } | ||
| 508 | } | ||
| 509 | |||
| 510 | [Fact] | ||
| 511 | public void PopulatesCustomTableWithFilePath() | ||
| 512 | { | ||
| 513 | var folder = TestData.Get(@"TestData"); | ||
| 514 | |||
| 515 | using (var fs = new DisposableFileSystem()) | ||
| 516 | { | ||
| 517 | var baseFolder = fs.GetFolder(); | ||
| 518 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 519 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 520 | |||
| 521 | var result = WixRunner.Execute(new[] | ||
| 522 | { | ||
| 523 | "build", | ||
| 524 | Path.Combine(folder, "CustomTable", "CustomTableWithFile.wxs"), | ||
| 525 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 526 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 527 | "-bindpath", Path.Combine(folder, "CustomTable", "data"), | ||
| 528 | "-intermediateFolder", intermediateFolder, | ||
| 529 | "-o", msiPath | ||
| 530 | }); | ||
| 531 | |||
| 532 | result.AssertSuccess(); | ||
| 533 | |||
| 534 | Assert.True(File.Exists(msiPath)); | ||
| 535 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableWithFile" }); | ||
| 536 | Assert.Equal(new[] | ||
| 537 | { | ||
| 538 | "CustomTableWithFile:Row1\t[Binary data]", | ||
| 539 | "CustomTableWithFile:Row2\t[Binary data]", | ||
| 540 | }, results); | ||
| 541 | } | ||
| 542 | } | ||
| 543 | |||
| 544 | [Fact] | ||
| 545 | public void PopulatesCustomTableWithFilePathSerialized() | ||
| 546 | { | ||
| 547 | var folder = TestData.Get(@"TestData"); | ||
| 548 | |||
| 549 | using (var fs = new DisposableFileSystem()) | ||
| 550 | { | ||
| 551 | var baseFolder = fs.GetFolder(); | ||
| 552 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 553 | var wixlibPath = Path.Combine(baseFolder, @"bin\test.wixlib"); | ||
| 554 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 555 | |||
| 556 | var result = WixRunner.Execute(new[] | ||
| 557 | { | ||
| 558 | "build", | ||
| 559 | Path.Combine(folder, "CustomTable", "CustomTableWithFile.wxs"), | ||
| 560 | "-bindpath", Path.Combine(folder, "CustomTable", "data"), | ||
| 561 | "-intermediateFolder", intermediateFolder, | ||
| 562 | "-o", wixlibPath | ||
| 563 | }); | ||
| 564 | |||
| 565 | result.AssertSuccess(); | ||
| 566 | |||
| 567 | result = WixRunner.Execute(new[] | ||
| 568 | { | ||
| 569 | "build", | ||
| 570 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 571 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 572 | "-lib", wixlibPath, | ||
| 573 | "-bindpath", Path.Combine(folder, "CustomTable", "data"), | ||
| 574 | "-intermediateFolder", intermediateFolder, | ||
| 575 | "-o", msiPath | ||
| 576 | }); | ||
| 577 | |||
| 578 | result.AssertSuccess(); | ||
| 579 | |||
| 580 | Assert.True(File.Exists(msiPath)); | ||
| 581 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTableWithFile" }); | ||
| 582 | Assert.Equal(new[] | ||
| 583 | { | ||
| 584 | "CustomTableWithFile:Row1\t[Binary data]", | ||
| 585 | "CustomTableWithFile:Row2\t[Binary data]", | ||
| 586 | }, results); | ||
| 587 | } | ||
| 588 | } | ||
| 589 | |||
| 590 | [Fact] | ||
| 476 | public void UnrealCustomTableIsNotPresentInMsi() | 591 | public void UnrealCustomTableIsNotPresentInMsi() |
| 477 | { | 592 | { |
| 478 | var folder = TestData.Get(@"TestData"); | 593 | var folder = TestData.Get(@"TestData"); |
