main
cs 51 lines 1.85 KB
Raw
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.Converters
4 {
5 using System;
6 using System.Xml.Linq;
7 using WixInternal.TestSupport;
8 using WixToolset.Converters;
9 using WixToolsetTest.Converters.Mocks;
10 using Xunit;
11
12 public class DirectXExtensionFixture : BaseConverterFixture
13 {
14 [Fact]
15 public void FixUIRefs()
16 {
17 var parse = String.Join(Environment.NewLine,
18 "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>",
19 " <Fragment>",
20 " <PropertyRef Id=\"WIX_DIRECTX_PIXELSHADERVERSION\" />",
21 " <UI>",
22 " <PropertyRef Id=\"WIX_DIRECTX_VERTEXSHADERVERSION\" />",
23 " </UI>",
24 " </Fragment>",
25 "</Wix>");
26
27 var expected = new[]
28 {
29 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:directx=\"http://wixtoolset.org/schemas/v4/wxs/directx\">",
30 " <Fragment>",
31 " <directx:GetCapabilities />",
32 " <UI>",
33 " <directx:GetCapabilities />",
34 " </UI>",
35 " </Fragment>",
36 "</Wix>"
37 };
38
39 var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
40
41 var messaging = new MockMessaging();
42 var converter = new WixConverter(messaging, 2, null, null);
43
44 var errors = converter.ConvertDocument(document);
45 Assert.Equal(3, errors);
46
47 var actualLines = UnformattedDocumentLines(document);
48 WixAssert.CompareLineByLine(expected, actualLines);
49 }
50 }
51 }