From 612dc390ecd90bf4079ad7545f4a4832ce8f702d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 27 Apr 2021 22:37:33 -0700 Subject: Move Converters into wix --- .../CustomTableFixture.cs | 363 --------------------- 1 file changed, 363 deletions(-) delete mode 100644 src/test/WixToolsetTest.Converters/CustomTableFixture.cs (limited to 'src/test/WixToolsetTest.Converters/CustomTableFixture.cs') diff --git a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs deleted file mode 100644 index 2b81a863..00000000 --- a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs +++ /dev/null @@ -1,363 +0,0 @@ -// 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 WixBuildTools.TestSupport; - using WixToolset.Converters; - using WixToolsetTest.Converters.Mocks; - using Xunit; - - public class CustomTableFixture : BaseConverterFixture - { - [Fact] - public void FixCustomTableCategoryAndModularization() - { - 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); - } - - [Fact] - public void FixCustomRowTextValue() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - " ", - " Some value", - " ", - " ", - " ", - " ", - ""); - - 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); - } - - [Fact] - public void FixCustomRowCdataValue() - { - 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 FixCustomRowWithoutValue() - { - 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 CanConvertBundleCustomTableBootstrapperApplicationData() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - " ", - " ", - " Row1", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - " ", - " ", - " ", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new MockMessaging(); - var converter = new WixConverter(messaging, 2, customTableTarget: CustomTableTarget.Bundle); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertBundleCustomTableRef() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - " ", - " Row1", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - " ", - " ", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new MockMessaging(); - var converter = new WixConverter(messaging, 2, customTableTarget: CustomTableTarget.Bundle); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertMsiCustomTableBootstrapperApplicationData() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - " ", - " ", - " Row1", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - " ", - " ", - " ", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new MockMessaging(); - var converter = new WixConverter(messaging, 2, customTableTarget: CustomTableTarget.Msi); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertMsiCustomTableRef() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - " ", - " Row1", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - " ", - " ", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new MockMessaging(); - var converter = new WixConverter(messaging, 2, customTableTarget: CustomTableTarget.Msi); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanDetectAmbiguousCustomTableBootstrapperApplicationData() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new MockMessaging(); - var converter = new WixConverter(messaging, 2); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanRemoveBootstrapperApplicationDataFromRealCustomTable() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new MockMessaging(); - var converter = new WixConverter(messaging, 2); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - } -} -- cgit v1.2.3-55-g6feb