diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-03 11:38:20 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-03 13:51:31 +1000 |
commit | 11112ebcdf97d4fa53e34d9dfe48410ff2378435 (patch) | |
tree | d995b68bb319a052c2259c8a4b6dbdf665926fca /src/test | |
parent | 37356647817b72a336eeedaa7472e268a04054c8 (diff) | |
download | wix-11112ebcdf97d4fa53e34d9dfe48410ff2378435.tar.gz wix-11112ebcdf97d4fa53e34d9dfe48410ff2378435.tar.bz2 wix-11112ebcdf97d4fa53e34d9dfe48410ff2378435.zip |
Use TupleIdIsPrimaryKey.
Diffstat (limited to 'src/test')
5 files changed, 9 insertions, 15 deletions
diff --git a/src/test/Example.Extension/ExampleCompilerExtension.cs b/src/test/Example.Extension/ExampleCompilerExtension.cs index 52168adc..e821b7b6 100644 --- a/src/test/Example.Extension/ExampleCompilerExtension.cs +++ b/src/test/Example.Extension/ExampleCompilerExtension.cs | |||
@@ -88,9 +88,8 @@ namespace Example.Extension | |||
88 | 88 | ||
89 | if (!this.Messaging.EncounteredError) | 89 | if (!this.Messaging.EncounteredError) |
90 | { | 90 | { |
91 | var tuple = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Example"); | 91 | var tuple = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Example", id); |
92 | tuple.Set(0, id.Id); | 92 | tuple.Set(0, value); |
93 | tuple.Set(1, value); | ||
94 | } | 93 | } |
95 | } | 94 | } |
96 | 95 | ||
diff --git a/src/test/Example.Extension/ExampleTuple.cs b/src/test/Example.Extension/ExampleTuple.cs index 0fc0d82c..f2bcb925 100644 --- a/src/test/Example.Extension/ExampleTuple.cs +++ b/src/test/Example.Extension/ExampleTuple.cs | |||
@@ -1,4 +1,4 @@ | |||
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. | 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 | 2 | ||
3 | namespace Example.Extension | 3 | namespace Example.Extension |
4 | { | 4 | { |
@@ -6,7 +6,6 @@ namespace Example.Extension | |||
6 | 6 | ||
7 | public enum ExampleTupleFields | 7 | public enum ExampleTupleFields |
8 | { | 8 | { |
9 | Example, | ||
10 | Value, | 9 | Value, |
11 | } | 10 | } |
12 | 11 | ||
diff --git a/src/test/Example.Extension/ExampleTupleDefinitions.cs b/src/test/Example.Extension/ExampleTupleDefinitions.cs index a9771509..dd8b5bbf 100644 --- a/src/test/Example.Extension/ExampleTupleDefinitions.cs +++ b/src/test/Example.Extension/ExampleTupleDefinitions.cs | |||
@@ -13,7 +13,6 @@ namespace Example.Extension | |||
13 | ExampleName, | 13 | ExampleName, |
14 | new[] | 14 | new[] |
15 | { | 15 | { |
16 | new IntermediateFieldDefinition(nameof(ExampleTupleFields.Example), IntermediateFieldType.String), | ||
17 | new IntermediateFieldDefinition(nameof(ExampleTupleFields.Value), IntermediateFieldType.String), | 16 | new IntermediateFieldDefinition(nameof(ExampleTupleFields.Value), IntermediateFieldType.String), |
18 | }, | 17 | }, |
19 | typeof(ExampleTuple)); | 18 | typeof(ExampleTuple)); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index b75e8ad9..3103f94f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
@@ -63,9 +63,8 @@ namespace WixToolsetTest.CoreIntegration | |||
63 | Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); | 63 | Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); |
64 | 64 | ||
65 | var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single(); | 65 | var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single(); |
66 | Assert.Null(example.Id?.Id); | 66 | Assert.Equal("Foo", example.Id?.Id); |
67 | Assert.Equal("Foo", example[0].AsString()); | 67 | Assert.Equal("Bar", example[0].AsString()); |
68 | Assert.Equal("Bar", example[1].AsString()); | ||
69 | } | 68 | } |
70 | } | 69 | } |
71 | 70 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs index c7af6439..0e740554 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs | |||
@@ -168,9 +168,8 @@ namespace WixToolsetTest.CoreIntegration | |||
168 | Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); | 168 | Assert.Equal(@"example.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); |
169 | 169 | ||
170 | var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single(); | 170 | var example = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).Single(); |
171 | Assert.Null(example.Id?.Id); | 171 | Assert.Equal("Foo", example.Id?.Id); |
172 | Assert.Equal("Foo", example[0].AsString()); | 172 | Assert.Equal("Bar", example[0].AsString()); |
173 | Assert.Equal("Bar", example[1].AsString()); | ||
174 | } | 173 | } |
175 | } | 174 | } |
176 | 175 | ||
@@ -232,9 +231,8 @@ namespace WixToolsetTest.CoreIntegration | |||
232 | Assert.Equal(@"other.txt", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); | 231 | Assert.Equal(@"other.txt", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); |
233 | 232 | ||
234 | var examples = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).ToArray(); | 233 | var examples = section.Tuples.Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension).ToArray(); |
235 | Assert.Equal(new string[] { null, null }, examples.Select(t => t.Id?.Id).ToArray()); | 234 | Assert.Equal(new string[] { "Foo", "Other" }, examples.Select(t => t.Id?.Id).ToArray()); |
236 | Assert.Equal(new[] { "Foo", "Other" }, examples.Select(t => t.AsString(0)).ToArray()); | 235 | Assert.Equal(new[] { "Bar", "Value" }, examples.Select(t => t[0].AsString()).ToArray()); |
237 | Assert.Equal(new[] { "Bar", "Value" }, examples.Select(t => t[1].AsString()).ToArray()); | ||
238 | } | 236 | } |
239 | } | 237 | } |
240 | } | 238 | } |