aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.Converters/TagFixture.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/WixToolsetTest.Converters/TagFixture.cs')
-rw-r--r--src/test/WixToolsetTest.Converters/TagFixture.cs111
1 files changed, 0 insertions, 111 deletions
diff --git a/src/test/WixToolsetTest.Converters/TagFixture.cs b/src/test/WixToolsetTest.Converters/TagFixture.cs
deleted file mode 100644
index 5e07c83b..00000000
--- a/src/test/WixToolsetTest.Converters/TagFixture.cs
+++ /dev/null
@@ -1,111 +0,0 @@
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
3namespace WixToolsetTest.Converters
4{
5 using System;
6 using System.Xml.Linq;
7 using WixBuildTools.TestSupport;
8 using WixToolset.Converters;
9 using WixToolsetTest.Converters.Mocks;
10 using Xunit;
11
12 public class TagFixture : BaseConverterFixture
13 {
14 [Fact]
15 public void FixTagExtension()
16 {
17 var parse = String.Join(Environment.NewLine,
18 "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:tag='http://schemas.microsoft.com/wix/TagExtension'>",
19 " <Product>",
20 " <tag:Tag Regid='wixtoolset.org' InstallDirectory='InstallFolder' />",
21 " </Product>",
22 "</Wix>");
23
24 var expected = new[]
25 {
26 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
27 " <Package>",
28 " <SoftwareTag Regid=\"wixtoolset.org\" InstallDirectory=\"InstallFolder\" />",
29 " </Package>",
30 "</Wix>"
31 };
32
33 var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
34
35 var messaging = new MockMessaging();
36 var converter = new WixConverter(messaging, 2, null, null);
37
38 var errors = converter.ConvertDocument(document);
39 Assert.Equal(4, errors);
40
41 var actualLines = UnformattedDocumentLines(document);
42 WixAssert.CompareLineByLine(expected, actualLines);
43 }
44
45 [Fact]
46 public void FixTagExtensionDeprecations()
47 {
48 var parse = String.Join(Environment.NewLine,
49 "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:tag='http://schemas.microsoft.com/wix/TagExtension'>",
50 " <Product>",
51 " <tag:Tag Regid='wixtoolset.org' InstallDirectory='InstallFolder' Licensed='true' Type='component' Win64='yes' />",
52 " </Product>",
53 "</Wix>");
54
55 var expected = new[]
56 {
57 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
58 " <Package>",
59 " <SoftwareTag Regid=\"wixtoolset.org\" InstallDirectory=\"InstallFolder\" Bitness=\"always64\" />",
60 " </Package>",
61 "</Wix>"
62 };
63
64 var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
65
66 var messaging = new MockMessaging();
67 var converter = new WixConverter(messaging, 2, null, null);
68
69 var errors = converter.ConvertDocument(document);
70 Assert.Equal(7, errors);
71
72 var actualLines = UnformattedDocumentLines(document);
73 WixAssert.CompareLineByLine(expected, actualLines);
74 }
75
76 [Fact]
77 public void FixTagExtensionTagRef()
78 {
79 var parse = String.Join(Environment.NewLine,
80 "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:tag='http://schemas.microsoft.com/wix/TagExtension'>",
81 " <Fragment>",
82 " <PatchFamily>",
83 " <tag:TagRef Regid='wixtoolset.org' />",
84 " </PatchFamily>",
85 " </Fragment>",
86 "</Wix>");
87
88 var expected = new[]
89 {
90 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
91 " <Fragment>",
92 " <PatchFamily>",
93 " <SoftwareTagRef Regid=\"wixtoolset.org\" />",
94 " </PatchFamily>",
95 " </Fragment>",
96 "</Wix>"
97 };
98
99 var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
100
101 var messaging = new MockMessaging();
102 var converter = new WixConverter(messaging, 2, null, null);
103
104 var errors = converter.ConvertDocument(document);
105 Assert.Equal(3, errors);
106
107 var actualLines = UnformattedDocumentLines(document);
108 WixAssert.CompareLineByLine(expected, actualLines);
109 }
110 }
111}