Skip to content

Commit d23bc10

Browse files
committed
🔧 Fix(Test): Some functions only supported on serveral platforms.
1 parent 6f8ed42 commit d23bc10

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎Common.BasicHelper.Test/Utils/Extensions/Dumpper_Tests.cs‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ public void Test_Dump()
1414
.Dump()
1515
;
1616

17-
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
18-
foreach (var iface in interfaces)
19-
iface.Dump();
17+
if (OperatingSystem.IsWindows())
18+
{
19+
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
20+
foreach (var iface in interfaces)
21+
iface.Dump();
22+
}
2023
}
2124

2225
[TestMethod()]
@@ -28,9 +31,12 @@ public void Test_Dump2Lines()
2831
.Dump2Lines()
2932
;
3033

31-
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
32-
foreach (var iface in interfaces)
33-
iface.Dump2Lines();
34+
if (OperatingSystem.IsWindows())
35+
{
36+
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
37+
foreach (var iface in interfaces)
38+
iface.Dump2Lines();
39+
}
3440
}
3541

3642
[TestMethod()]

0 commit comments

Comments
 (0)