From 3f0af880a3d8a41e1a6ac342f8fba06d22b223a0 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 1 Jul 2020 01:59:21 -0700 Subject: Make Feature/@Absent and Feature/@AllowAdvertise consistent Conversion for wixtoolset/issues#5990 --- .../WixToolsetTest.Converters/FeatureFixture.cs | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/test/WixToolsetTest.Converters/FeatureFixture.cs (limited to 'src/test') diff --git a/src/test/WixToolsetTest.Converters/FeatureFixture.cs b/src/test/WixToolsetTest.Converters/FeatureFixture.cs new file mode 100644 index 00000000..9d943773 --- /dev/null +++ b/src/test/WixToolsetTest.Converters/FeatureFixture.cs @@ -0,0 +1,77 @@ +// 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. + +namespace WixToolsetTest.Converters +{ + using System; + using System.Xml.Linq; + using WixToolset.Converters; + using WixToolsetTest.Converters.Mocks; + using Xunit; + + public class FeatureFixture : BaseConverterFixture + { + [Fact] + public void FixAllowAttributes() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var expected = new[] + { + "", + " ", + " ", + " ", + "" + }; + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new MockMessaging(); + var converter = new WixConverter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + Assert.Equal(4, errors); + + var actualLines = UnformattedDocumentLines(document); + CompareLineByLine(expected, actualLines); + } + + [Fact] + public void RemoveDeprecatedAllowAdvertiseAttributes() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var expected = new[] + { + "", + " ", + " ", + " ", + "" + }; + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new MockMessaging(); + var converter = new WixConverter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + Assert.Equal(3, errors); + + var actualLines = UnformattedDocumentLines(document); + CompareLineByLine(expected, actualLines); + } + } +} -- cgit v1.2.3-55-g6feb