From 05cafee83e597badaf842bd7e6ba06f4d8fe193f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 8 Dec 2020 15:14:40 -0600 Subject: Add conversion for BootstrapperApplicationDll and bal:UseUILanguages. --- .../BootstrapperApplicationFixture.cs | 144 ++++++++++++++++++++- 1 file changed, 141 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs index 68a8afc8..dc5bae00 100644 --- a/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs +++ b/src/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs @@ -12,12 +12,14 @@ namespace WixToolsetTest.Converters public class BootstrapperApplicationFixture : BaseConverterFixture { [Fact] - public void SetsDpiUnawareFromV3() + public void CantCreateBootstrapperApplicationDllFromV3PayloadGroupRef() { var parse = String.Join(Environment.NewLine, "", " ", - " ", + " ", + " ", + " ", " ", ""); @@ -25,7 +27,9 @@ namespace WixToolsetTest.Converters { "", " ", - " ", + " ", + " ", + " ", " ", "" }; @@ -42,6 +46,76 @@ namespace WixToolsetTest.Converters WixAssert.CompareLineByLine(expected, actualLines); } + [Fact] + public void CreateBootstrapperApplicationDllFromV3() + { + 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); + WixAssert.CompareLineByLine(expected, actualLines); + } + + [Fact] + public void CreateBootstrapperApplicationDllFromV3Payload() + { + 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); + WixAssert.CompareLineByLine(expected, actualLines); + } + [Fact] public void DoesntSetDpiUnawareFromV4() { @@ -72,5 +146,69 @@ namespace WixToolsetTest.Converters var actualLines = UnformattedDocumentLines(document); WixAssert.CompareLineByLine(expected, actualLines); } + + [Fact] + public void KeepsDpiAwarenessFromV4() + { + 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(1, errors); + + var actualLines = UnformattedDocumentLines(document); + WixAssert.CompareLineByLine(expected, actualLines); + } + + [Fact] + public void RemovesBalUseUILanguages() + { + 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); + WixAssert.CompareLineByLine(expected, actualLines); + } } } -- cgit v1.2.3-55-g6feb