@@ -8,26 +8,30 @@ namespace TechnitiumLibrary.UnitTests.TechnitiumLibrary.Net.Firewall
88 public sealed class WindowsFirewallTests
99 {
1010 [ TestMethod ]
11+ [ OSCondition ( OperatingSystems . Windows ) ]
1112 public void AddPort_ShouldThrow_WhenUnsupportedProtocol ( )
1213 {
1314 // Protocol ICMPv4 cannot be added using AddPort
1415 Assert . ThrowsExactly < Exception > ( ( ) => WindowsFirewall . AddPort ( "bad" , Protocol . ICMPv4 , port : 55 , enable : true ) ) ;
1516 }
1617
1718 [ TestMethod ]
19+ [ OSCondition ( OperatingSystems . Windows ) ]
1820 public void RemovePort_ShouldThrow_WhenUnsupportedProtocol ( )
1921 {
2022 // RemovePort validates only TCP, UDP, ANY
2123 Assert . ThrowsExactly < Exception > ( ( ) => WindowsFirewall . RemovePort ( Protocol . IGMP , 123 ) ) ;
2224 }
2325
2426 [ TestMethod ]
27+ [ OSCondition ( OperatingSystems . Windows ) ]
2528 public void PortExists_ShouldThrow_WhenUnsupportedProtocol ( )
2629 {
2730 Assert . ThrowsExactly < Exception > ( ( ) => WindowsFirewall . PortExists ( Protocol . IGMP , 44 ) ) ;
2831 }
2932
3033 [ TestMethod ]
34+ [ OSCondition ( OperatingSystems . Windows ) ]
3135 public void RuleExistsVista_ShouldReturnDoesNotExist_WhenInputsClearlyNotMatchingAnything ( )
3236 {
3337 // Since firewall is not guaranteed to have this rule,
@@ -40,6 +44,7 @@ public void RuleExistsVista_ShouldReturnDoesNotExist_WhenInputsClearlyNotMatchin
4044 }
4145
4246 [ TestMethod ]
47+ [ OSCondition ( OperatingSystems . Windows ) ]
4348 public void ApplicationExists_ShouldReturnDoesNotExist_WhenApplicationIsNotRegistered ( )
4449 {
4550 // Public observable guarantee:
0 commit comments