diff options
Diffstat (limited to 'src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs')
-rw-r--r-- | src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs index 65016865..4b9aecd7 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs | |||
@@ -6,14 +6,15 @@ namespace WixToolsetTest.Firewall | |||
6 | using System.IO; | 6 | using System.IO; |
7 | using System.Linq; | 7 | using System.Linq; |
8 | using System.Xml.Linq; | 8 | using System.Xml.Linq; |
9 | using WixInternal.Core.TestPackage; | 9 | using Microsoft.VisualStudio.TestTools.UnitTesting; |
10 | using WixInternal.TestSupport; | 10 | using WixInternal.Core.MSTestPackage; |
11 | using WixInternal.MSTestSupport; | ||
11 | using WixToolset.Firewall; | 12 | using WixToolset.Firewall; |
12 | using Xunit; | ||
13 | 13 | ||
14 | [TestClass] | ||
14 | public class FirewallExtensionFixture | 15 | public class FirewallExtensionFixture |
15 | { | 16 | { |
16 | [Fact] | 17 | [TestMethod] |
17 | public void CanBuildUsingFirewall() | 18 | public void CanBuildUsingFirewall() |
18 | { | 19 | { |
19 | var folder = TestData.Get(@"TestData\UsingFirewall"); | 20 | var folder = TestData.Get(@"TestData\UsingFirewall"); |
@@ -52,7 +53,7 @@ namespace WixToolsetTest.Firewall | |||
52 | }, results); | 53 | }, results); |
53 | } | 54 | } |
54 | 55 | ||
55 | [Fact] | 56 | [TestMethod] |
56 | public void CanBuildUsingFirewallARM64() | 57 | public void CanBuildUsingFirewallARM64() |
57 | { | 58 | { |
58 | var folder = TestData.Get(@"TestData\UsingFirewall"); | 59 | var folder = TestData.Get(@"TestData\UsingFirewall"); |
@@ -91,7 +92,7 @@ namespace WixToolsetTest.Firewall | |||
91 | }, results); | 92 | }, results); |
92 | } | 93 | } |
93 | 94 | ||
94 | [Fact] | 95 | [TestMethod] |
95 | public void CanBuildWithProperties() | 96 | public void CanBuildWithProperties() |
96 | { | 97 | { |
97 | var folder = TestData.Get(@"TestData\UsingProperties"); | 98 | var folder = TestData.Get(@"TestData\UsingProperties"); |
@@ -112,7 +113,7 @@ namespace WixToolsetTest.Firewall | |||
112 | }, results); | 113 | }, results); |
113 | } | 114 | } |
114 | 115 | ||
115 | [Fact] | 116 | [TestMethod] |
116 | public void CanBuildWithPropertiesUsingFirewallARM64() | 117 | public void CanBuildWithPropertiesUsingFirewallARM64() |
117 | { | 118 | { |
118 | var folder = TestData.Get(@"TestData\UsingProperties"); | 119 | var folder = TestData.Get(@"TestData\UsingProperties"); |
@@ -133,7 +134,7 @@ namespace WixToolsetTest.Firewall | |||
133 | }, results); | 134 | }, results); |
134 | } | 135 | } |
135 | 136 | ||
136 | [Fact] | 137 | [TestMethod] |
137 | public void CanRoundtripFirewallExceptions() | 138 | public void CanRoundtripFirewallExceptions() |
138 | { | 139 | { |
139 | var folder = TestData.Get(@"TestData", "UsingFirewall"); | 140 | var folder = TestData.Get(@"TestData", "UsingFirewall"); |
@@ -181,7 +182,7 @@ namespace WixToolsetTest.Firewall | |||
181 | }, actual.Select(a => a.Name).ToArray()); | 182 | }, actual.Select(a => a.Name).ToArray()); |
182 | } | 183 | } |
183 | 184 | ||
184 | [Fact] | 185 | [TestMethod] |
185 | public void CanRoundtripFirewallExceptionsWithProperties() | 186 | public void CanRoundtripFirewallExceptionsWithProperties() |
186 | { | 187 | { |
187 | var folder = TestData.Get(@"TestData", "UsingProperties"); | 188 | var folder = TestData.Get(@"TestData", "UsingProperties"); |
@@ -212,7 +213,7 @@ namespace WixToolsetTest.Firewall | |||
212 | }, actual.Select(a => a.Name).ToArray()); | 213 | }, actual.Select(a => a.Name).ToArray()); |
213 | } | 214 | } |
214 | 215 | ||
215 | [Fact] | 216 | [TestMethod] |
216 | public void RoundtripAttributesAreCorrectForApp() | 217 | public void RoundtripAttributesAreCorrectForApp() |
217 | { | 218 | { |
218 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleApp"); | 219 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleApp"); |
@@ -230,7 +231,7 @@ namespace WixToolsetTest.Firewall | |||
230 | }, actual.Attributes); | 231 | }, actual.Attributes); |
231 | } | 232 | } |
232 | 233 | ||
233 | [Fact] | 234 | [TestMethod] |
234 | public void RoundtripAttributesAreCorrectForPort() | 235 | public void RoundtripAttributesAreCorrectForPort() |
235 | { | 236 | { |
236 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExamplePort"); | 237 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExamplePort"); |
@@ -248,7 +249,7 @@ namespace WixToolsetTest.Firewall | |||
248 | }, actual.Attributes); | 249 | }, actual.Attributes); |
249 | } | 250 | } |
250 | 251 | ||
251 | [Fact] | 252 | [TestMethod] |
252 | public void RoundtripAttributesAreCorrectForDNSScope() | 253 | public void RoundtripAttributesAreCorrectForDNSScope() |
253 | { | 254 | { |
254 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDNSScope"); | 255 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDNSScope"); |
@@ -264,7 +265,7 @@ namespace WixToolsetTest.Firewall | |||
264 | }, actual.Attributes); | 265 | }, actual.Attributes); |
265 | } | 266 | } |
266 | 267 | ||
267 | [Fact] | 268 | [TestMethod] |
268 | public void RoundtripAttributesAreCorrectForDHCPScope() | 269 | public void RoundtripAttributesAreCorrectForDHCPScope() |
269 | { | 270 | { |
270 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDHCPScope"); | 271 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDHCPScope"); |
@@ -281,7 +282,7 @@ namespace WixToolsetTest.Firewall | |||
281 | }, actual.Attributes); | 282 | }, actual.Attributes); |
282 | } | 283 | } |
283 | 284 | ||
284 | [Fact] | 285 | [TestMethod] |
285 | public void RoundtripAttributesAreCorrectForWINSScope() | 286 | public void RoundtripAttributesAreCorrectForWINSScope() |
286 | { | 287 | { |
287 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleWINSScope"); | 288 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleWINSScope"); |
@@ -298,7 +299,7 @@ namespace WixToolsetTest.Firewall | |||
298 | }, actual.Attributes); | 299 | }, actual.Attributes); |
299 | } | 300 | } |
300 | 301 | ||
301 | [Fact] | 302 | [TestMethod] |
302 | public void RoundtripAttributesAreCorrectForDefaultGatewayScope() | 303 | public void RoundtripAttributesAreCorrectForDefaultGatewayScope() |
303 | { | 304 | { |
304 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDefaultGatewayScope"); | 305 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ExampleDefaultGatewayScope"); |
@@ -315,7 +316,7 @@ namespace WixToolsetTest.Firewall | |||
315 | }, actual.Attributes); | 316 | }, actual.Attributes); |
316 | } | 317 | } |
317 | 318 | ||
318 | [Fact] | 319 | [TestMethod] |
319 | public void RoundtripAttributesAreCorrectForINetFwRule3Values() | 320 | public void RoundtripAttributesAreCorrectForINetFwRule3Values() |
320 | { | 321 | { |
321 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "INetFwRule3 values"); | 322 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "INetFwRule3 values"); |
@@ -335,7 +336,7 @@ namespace WixToolsetTest.Firewall | |||
335 | }, actual.Attributes); | 336 | }, actual.Attributes); |
336 | } | 337 | } |
337 | 338 | ||
338 | [Fact] | 339 | [TestMethod] |
339 | public void RoundtripAttributesAreCorrectForINetFwRule3Properties() | 340 | public void RoundtripAttributesAreCorrectForINetFwRule3Properties() |
340 | { | 341 | { |
341 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "INetFwRule3 properties"); | 342 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "INetFwRule3 properties"); |
@@ -355,7 +356,7 @@ namespace WixToolsetTest.Firewall | |||
355 | }, actual.Attributes); | 356 | }, actual.Attributes); |
356 | } | 357 | } |
357 | 358 | ||
358 | [Fact] | 359 | [TestMethod] |
359 | public void RoundtripAttributesAreCorrectForGroupingValue() | 360 | public void RoundtripAttributesAreCorrectForGroupingValue() |
360 | { | 361 | { |
361 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "GroupingExample1"); | 362 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "GroupingExample1"); |
@@ -370,7 +371,7 @@ namespace WixToolsetTest.Firewall | |||
370 | }, actual.Attributes); | 371 | }, actual.Attributes); |
371 | } | 372 | } |
372 | 373 | ||
373 | [Fact] | 374 | [TestMethod] |
374 | public void RoundtripAttributesAreCorrectForGroupingProperty() | 375 | public void RoundtripAttributesAreCorrectForGroupingProperty() |
375 | { | 376 | { |
376 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "GroupingExample2"); | 377 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "GroupingExample2"); |
@@ -386,7 +387,7 @@ namespace WixToolsetTest.Firewall | |||
386 | }, actual.Attributes); | 387 | }, actual.Attributes); |
387 | } | 388 | } |
388 | 389 | ||
389 | [Fact] | 390 | [TestMethod] |
390 | public void RoundtripAttributesAreCorrectForIcmpValue() | 391 | public void RoundtripAttributesAreCorrectForIcmpValue() |
391 | { | 392 | { |
392 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ICMPExample1"); | 393 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ICMPExample1"); |
@@ -401,7 +402,7 @@ namespace WixToolsetTest.Firewall | |||
401 | }, actual.Attributes); | 402 | }, actual.Attributes); |
402 | } | 403 | } |
403 | 404 | ||
404 | [Fact] | 405 | [TestMethod] |
405 | public void RoundtripAttributesAreCorrectForIcmpProperty() | 406 | public void RoundtripAttributesAreCorrectForIcmpProperty() |
406 | { | 407 | { |
407 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ICMPExample2"); | 408 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "ICMPExample2"); |
@@ -416,7 +417,7 @@ namespace WixToolsetTest.Firewall | |||
416 | }, actual.Attributes); | 417 | }, actual.Attributes); |
417 | } | 418 | } |
418 | 419 | ||
419 | [Fact] | 420 | [TestMethod] |
420 | public void RoundtripAttributesAreCorrectForLocalScopeValue() | 421 | public void RoundtripAttributesAreCorrectForLocalScopeValue() |
421 | { | 422 | { |
422 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "LocalScopeExample1"); | 423 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "LocalScopeExample1"); |
@@ -431,7 +432,7 @@ namespace WixToolsetTest.Firewall | |||
431 | }, actual.Attributes); | 432 | }, actual.Attributes); |
432 | } | 433 | } |
433 | 434 | ||
434 | [Fact] | 435 | [TestMethod] |
435 | public void RoundtripAttributesAreCorrectForLocalScopeProperty() | 436 | public void RoundtripAttributesAreCorrectForLocalScopeProperty() |
436 | { | 437 | { |
437 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "LocalScopeExample2"); | 438 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "LocalScopeExample2"); |
@@ -446,7 +447,7 @@ namespace WixToolsetTest.Firewall | |||
446 | }, actual.Attributes); | 447 | }, actual.Attributes); |
447 | } | 448 | } |
448 | 449 | ||
449 | [Fact] | 450 | [TestMethod] |
450 | public void RoundtripAttributesAreCorrectForRemotePorts() | 451 | public void RoundtripAttributesAreCorrectForRemotePorts() |
451 | { | 452 | { |
452 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "RemotePortExample1"); | 453 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "RemotePortExample1"); |
@@ -462,7 +463,7 @@ namespace WixToolsetTest.Firewall | |||
462 | }, actual.Attributes); | 463 | }, actual.Attributes); |
463 | } | 464 | } |
464 | 465 | ||
465 | [Fact] | 466 | [TestMethod] |
466 | public void RoundtripAttributesAreCorrectForRemotePortsProperty() | 467 | public void RoundtripAttributesAreCorrectForRemotePortsProperty() |
467 | { | 468 | { |
468 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "RemotePortExample2"); | 469 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "RemotePortExample2"); |
@@ -478,7 +479,7 @@ namespace WixToolsetTest.Firewall | |||
478 | }, actual.Attributes); | 479 | }, actual.Attributes); |
479 | } | 480 | } |
480 | 481 | ||
481 | [Fact] | 482 | [TestMethod] |
482 | public void RoundtripAttributesAreCorrectWhenPropertiesAreUsed() | 483 | public void RoundtripAttributesAreCorrectWhenPropertiesAreUsed() |
483 | { | 484 | { |
484 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "[NAME]", "UsingProperties"); | 485 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "[NAME]", "UsingProperties"); |
@@ -526,10 +527,10 @@ namespace WixToolsetTest.Firewall | |||
526 | }); | 527 | }); |
527 | 528 | ||
528 | var nested = related.Select(e => e.Attributes().Single(a => a.Name.LocalName == "Name").Value); | 529 | var nested = related.Select(e => e.Attributes().Single(a => a.Name.LocalName == "Name").Value); |
529 | Assert.False(nested.Any()); | 530 | Assert.IsFalse(nested.Any()); |
530 | } | 531 | } |
531 | 532 | ||
532 | [Fact] | 533 | [TestMethod] |
533 | public void RoundtripAttributesAreCorrectWhenNestedPropertiesAreUsed() | 534 | public void RoundtripAttributesAreCorrectWhenNestedPropertiesAreUsed() |
534 | { | 535 | { |
535 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "Single Nested properties", "UsingProperties"); | 536 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "Single Nested properties", "UsingProperties"); |
@@ -559,10 +560,10 @@ namespace WixToolsetTest.Firewall | |||
559 | }); | 560 | }); |
560 | 561 | ||
561 | var nested = related.Select(e => e.Attributes().Single(a => a.Name.LocalName == "Name").Value); | 562 | var nested = related.Select(e => e.Attributes().Single(a => a.Name.LocalName == "Name").Value); |
562 | Assert.False(nested.Any()); | 563 | Assert.IsFalse(nested.Any()); |
563 | } | 564 | } |
564 | 565 | ||
565 | [Fact] | 566 | [TestMethod] |
566 | public void RoundtripAttributesAreCorrectWhenMultipleNestedPropertiesAreUsed() | 567 | public void RoundtripAttributesAreCorrectWhenMultipleNestedPropertiesAreUsed() |
567 | { | 568 | { |
568 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "Multiple Nested properties", "UsingProperties"); | 569 | var actual = BuildAndDecompileAndBuild("http://wixtoolset.org/schemas/v4/wxs/firewall", "Multiple Nested properties", "UsingProperties"); |