diff options
author | Rob Mensching <rob@firegiant.com> | 2017-12-06 11:21:42 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-12-06 11:21:42 -0800 |
commit | ca376995792d2e2a1a7f39760989496702a8f603 (patch) | |
tree | d9d2f35647d8fe77a91a63740d0ad267c32547b2 /src/test | |
parent | 53e877183abe0dbbb623c39380101bc369e9f265 (diff) | |
download | wix-ca376995792d2e2a1a7f39760989496702a8f603.tar.gz wix-ca376995792d2e2a1a7f39760989496702a8f603.tar.bz2 wix-ca376995792d2e2a1a7f39760989496702a8f603.zip |
Fix handling of long values and baseUri in path fields
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.Data/SerializeFixture.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Data/SerializeFixture.cs b/src/test/WixToolsetTest.Data/SerializeFixture.cs new file mode 100644 index 00000000..9883053f --- /dev/null +++ b/src/test/WixToolsetTest.Data/SerializeFixture.cs | |||
@@ -0,0 +1,43 @@ | |||
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.Data | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | using System.Linq; | ||
8 | using WixToolset.Data; | ||
9 | using WixToolset.Data.Tuples; | ||
10 | using Xunit; | ||
11 | |||
12 | public class SerializeFixture | ||
13 | { | ||
14 | [Fact] | ||
15 | public void CanSaveAndLoadIntermediate() | ||
16 | { | ||
17 | var sln = new SourceLineNumber("test.wxs", 1); | ||
18 | |||
19 | var section = new IntermediateSection("test", SectionType.Product, 65001); | ||
20 | |||
21 | section.Tuples.Add(new ComponentTuple(sln, new Identifier("TestComponent", AccessModifier.Public)) | ||
22 | { | ||
23 | ComponentId = new Guid(1, 0, 0, new byte[8]).ToString("B"), | ||
24 | Directory_ = "TestFolder", | ||
25 | Attributes = 2, | ||
26 | }); | ||
27 | |||
28 | var intermediate = new Intermediate("TestIntermediate", new[] { section }, null, null); | ||
29 | |||
30 | var path = Path.GetTempFileName(); | ||
31 | intermediate.Save(path); | ||
32 | |||
33 | var loaded = Intermediate.Load(path); | ||
34 | |||
35 | var tuple = (ComponentTuple)loaded.Sections.Single().Tuples.Single(); | ||
36 | |||
37 | Assert.Equal("TestComponent", tuple.Id.Id); | ||
38 | Assert.Equal(AccessModifier.Public, tuple.Id.Access); | ||
39 | Assert.Equal("TestFolder", tuple.Directory_); | ||
40 | Assert.Equal(2, tuple.Attributes); | ||
41 | } | ||
42 | } | ||
43 | } | ||