diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-03-26 15:21:06 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-03-30 21:30:04 +1000 |
| commit | afbc6889c73d58136cb8851858ca3c17f41dc2c5 (patch) | |
| tree | 1d7c66218176c7e8a28d49a4e22c60fe1e4e4c0d /src/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs | |
| parent | 192c5aa59b5d8e5e9df9095982317c224f3d4f04 (diff) | |
| download | wix-afbc6889c73d58136cb8851858ca3c17f41dc2c5.tar.gz wix-afbc6889c73d58136cb8851858ca3c17f41dc2c5.tar.bz2 wix-afbc6889c73d58136cb8851858ca3c17f41dc2c5.zip | |
Add BundleExtension element.
Add GetTestXml.
Fix issue with building with current version of burn.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs b/src/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs new file mode 100644 index 00000000..5330305e --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs | |||
| @@ -0,0 +1,62 @@ | |||
| 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.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.Collections.Generic; | ||
| 6 | using WixToolset.Core.TestPackage; | ||
| 7 | using Xunit; | ||
| 8 | |||
| 9 | public class TestXmlFixture | ||
| 10 | { | ||
| 11 | [Fact] | ||
| 12 | public void ChangesIgnoredAttributesToStarToHelpMakeTestsLessFragile() | ||
| 13 | { | ||
| 14 | var original = @"<Top One='f'> | ||
| 15 | <First Two='t'> | ||
| 16 | <Target One='a' Two='b' Three='c' /> | ||
| 17 | </First> | ||
| 18 | <Target One='z' Two='x' Three = 'y' /> | ||
| 19 | </Top>"; | ||
| 20 | var expected = "<Top One='f'><First Two='t'><Target One='*' Two='*' Three='c' /></First><Target One='*' Two='*' Three='y' /></Top>"; | ||
| 21 | var ignored = new Dictionary<string, List<string>> { { "Target", new List<string> { "One", "Two", "Missing" } } }; | ||
| 22 | Assert.Equal(expected, original.GetTestXml(ignored)); | ||
| 23 | } | ||
| 24 | |||
| 25 | [Fact] | ||
| 26 | public void OutputsSingleQuotesSinceDoubleQuotesInCsharpLiteralStringsArePainful() | ||
| 27 | { | ||
| 28 | var original = "<Test Simple=\"\" EscapedDoubleQuote=\""\" SingleQuoteValue=\"'test'\" Alternating='\"' AlternatingEscaped='"' />"; | ||
| 29 | var expected = "<Test Simple='' EscapedDoubleQuote='\"' SingleQuoteValue=''test'' Alternating='\"' AlternatingEscaped='\"' />"; | ||
| 30 | Assert.Equal(expected, original.GetTestXml()); | ||
| 31 | } | ||
| 32 | |||
| 33 | [Fact] | ||
| 34 | public void RemovesAllNamespacesToReduceTyping() | ||
| 35 | { | ||
| 36 | var original = "<Test xmlns='a'><Child xmlns:b='b'><Grandchild xmlns:c='c' /><Grandchild /></Child></Test>"; | ||
| 37 | var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>"; | ||
| 38 | Assert.Equal(expected, original.GetTestXml()); | ||
| 39 | } | ||
| 40 | |||
| 41 | [Fact] | ||
| 42 | public void RemovesUnnecessaryWhitespaceToAvoidLineEndingIssues() | ||
| 43 | { | ||
| 44 | var original = @"<Test> | ||
| 45 | <Child> | ||
| 46 | <Grandchild /> | ||
| 47 | <Grandchild /> | ||
| 48 | </Child> | ||
| 49 | </Test>"; | ||
| 50 | var expected = "<Test><Child><Grandchild /><Grandchild /></Child></Test>"; | ||
| 51 | Assert.Equal(expected, original.GetTestXml()); | ||
| 52 | } | ||
| 53 | |||
| 54 | [Fact] | ||
| 55 | public void RemovesXmlDeclarationToReduceTyping() | ||
| 56 | { | ||
| 57 | var original = "<?xml version='1.0'?><Test />"; | ||
| 58 | var expected = "<Test />"; | ||
| 59 | Assert.Equal(expected, original.GetTestXml()); | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } | ||
