diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.Converters/FeatureFixture.cs | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/test/WixToolsetTest.Converters/FeatureFixture.cs b/src/test/WixToolsetTest.Converters/FeatureFixture.cs index 9d943773..8240945d 100644 --- a/src/test/WixToolsetTest.Converters/FeatureFixture.cs +++ b/src/test/WixToolsetTest.Converters/FeatureFixture.cs | |||
@@ -25,7 +25,7 @@ namespace WixToolsetTest.Converters | |||
25 | { | 25 | { |
26 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 26 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
27 | " <Fragment>", | 27 | " <Fragment>", |
28 | " <Feature AllowAdvertise=\"yes\" AllowAbsent=\"yes\" />", | 28 | " <Feature AllowAdvertise=\"yes\" />", |
29 | " </Fragment>", | 29 | " </Fragment>", |
30 | "</Wix>" | 30 | "</Wix>" |
31 | }; | 31 | }; |
@@ -43,6 +43,38 @@ namespace WixToolsetTest.Converters | |||
43 | } | 43 | } |
44 | 44 | ||
45 | [Fact] | 45 | [Fact] |
46 | public void FixDisallowAttributes() | ||
47 | { | ||
48 | var parse = String.Join(Environment.NewLine, | ||
49 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
50 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
51 | " <Fragment>", | ||
52 | " <Feature Absent='disallow' AllowAdvertise='no' />", | ||
53 | " </Fragment>", | ||
54 | "</Wix>"); | ||
55 | |||
56 | var expected = new[] | ||
57 | { | ||
58 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
59 | " <Fragment>", | ||
60 | " <Feature AllowAdvertise=\"no\" AllowAbsent=\"no\" />", | ||
61 | " </Fragment>", | ||
62 | "</Wix>" | ||
63 | }; | ||
64 | |||
65 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
66 | |||
67 | var messaging = new MockMessaging(); | ||
68 | var converter = new WixConverter(messaging, 2, null, null); | ||
69 | |||
70 | var errors = converter.ConvertDocument(document); | ||
71 | Assert.Equal(3, errors); | ||
72 | |||
73 | var actualLines = UnformattedDocumentLines(document); | ||
74 | CompareLineByLine(expected, actualLines); | ||
75 | } | ||
76 | |||
77 | [Fact] | ||
46 | public void RemoveDeprecatedAllowAdvertiseAttributes() | 78 | public void RemoveDeprecatedAllowAdvertiseAttributes() |
47 | { | 79 | { |
48 | var parse = String.Join(Environment.NewLine, | 80 | var parse = String.Join(Environment.NewLine, |