diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2019-10-15 11:12:57 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2019-10-15 11:20:07 +1000 |
| commit | aa5a5e492f9a7060720056c27963cf1d06b4737f (patch) | |
| tree | 69aae3e2ed9b5dd781c1e0f52c8ef54576671b24 /src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | |
| parent | 868956398ebb9ac6cc47266b185ec39c94b57b6e (diff) | |
| download | wix-aa5a5e492f9a7060720056c27963cf1d06b4737f.tar.gz wix-aa5a5e492f9a7060720056c27963cf1d06b4737f.tar.bz2 wix-aa5a5e492f9a7060720056c27963cf1d06b4737f.zip | |
Add failing test for AsString on a number field with 0.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs index 88491eac..061eae07 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | |||
| @@ -21,18 +21,19 @@ namespace WixToolsetTest.CoreIntegration | |||
| 21 | { | 21 | { |
| 22 | var baseFolder = fs.GetFolder(); | 22 | var baseFolder = fs.GetFolder(); |
| 23 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 23 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 24 | var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); | ||
| 24 | 25 | ||
| 25 | var result = WixRunner.Execute(new[] | 26 | var result = WixRunner.Execute(new[] |
| 26 | { | 27 | { |
| 27 | "build", | 28 | "build", |
| 28 | Path.Combine(folder, "DetectOnly.wxs"), | 29 | Path.Combine(folder, "DetectOnly.wxs"), |
| 29 | "-intermediateFolder", intermediateFolder, | 30 | "-intermediateFolder", intermediateFolder, |
| 30 | "-o", Path.Combine(intermediateFolder, @"test.wixlib"), | 31 | "-o", wixlibPath, |
| 31 | }); | 32 | }); |
| 32 | 33 | ||
| 33 | result.AssertSuccess(); | 34 | result.AssertSuccess(); |
| 34 | 35 | ||
| 35 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wixlib")); | 36 | var intermediate = Intermediate.Load(wixlibPath); |
| 36 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); | 37 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); |
| 37 | var wixSimpleRefTuples = allTuples.OfType<WixSimpleReferenceTuple>(); | 38 | var wixSimpleRefTuples = allTuples.OfType<WixSimpleReferenceTuple>(); |
| 38 | var repRef = wixSimpleRefTuples.Where(t => t.Table == "WixAction" && | 39 | var repRef = wixSimpleRefTuples.Where(t => t.Table == "WixAction" && |
| @@ -41,5 +42,40 @@ namespace WixToolsetTest.CoreIntegration | |||
| 41 | Assert.NotNull(repRef); | 42 | Assert.NotNull(repRef); |
| 42 | } | 43 | } |
| 43 | } | 44 | } |
| 45 | |||
| 46 | [Fact(Skip = "Test demonstrates failure")] | ||
| 47 | public void TypeLibLanguageAsStringReturnsZero() | ||
| 48 | { | ||
| 49 | var folder = TestData.Get(@"TestData\TypeLib"); | ||
| 50 | |||
| 51 | using (var fs = new DisposableFileSystem()) | ||
| 52 | { | ||
| 53 | var baseFolder = fs.GetFolder(); | ||
| 54 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 55 | var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); | ||
| 56 | |||
| 57 | var result = WixRunner.Execute(new[] | ||
| 58 | { | ||
| 59 | "build", | ||
| 60 | Path.Combine(folder, "Language0.wxs"), | ||
| 61 | "-intermediateFolder", intermediateFolder, | ||
| 62 | "-o", wixlibPath | ||
| 63 | }); | ||
| 64 | |||
| 65 | result.AssertSuccess(); | ||
| 66 | |||
| 67 | var intermediate = Intermediate.Load(wixlibPath); | ||
| 68 | var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); | ||
| 69 | var typeLibTuple = allTuples.OfType<TypeLibTuple>() | ||
| 70 | .SingleOrDefault(); | ||
| 71 | Assert.NotNull(typeLibTuple); | ||
| 72 | |||
| 73 | var fields = typeLibTuple.Fields.Select(field => field?.Type == IntermediateFieldType.Bool | ||
| 74 | ? field.AsNullableNumber()?.ToString() | ||
| 75 | : field?.AsString()) | ||
| 76 | .ToList(); | ||
| 77 | Assert.Equal("0", fields[1]); | ||
| 78 | } | ||
| 79 | } | ||
| 44 | } | 80 | } |
| 45 | } | 81 | } |
