File tree Expand file tree Collapse file tree
Common.BasicHelper.Test/Network Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,27 +8,36 @@ public class NetUtils_Tests
88 [ TestMethod ]
99 public void Test_IsWebConected ( )
1010 {
11- Assert . IsTrue ( NetUtils . IsWebConected ( "localhost" , 3 ) ) ;
12- Assert . IsFalse ( NetUtils . IsWebConected ( "192.168.255.255" , 3 ) ) ;
11+ if ( OperatingSystem . IsWindows ( ) )
12+ {
13+ Assert . IsTrue ( NetUtils . IsWebConected ( "localhost" , 3 ) ) ;
14+ Assert . IsFalse ( NetUtils . IsWebConected ( "192.168.255.255" , 3 ) ) ;
15+ }
1316 }
1417
1518 [ TestMethod ]
1619 public void Test_DownloadFile ( )
1720 {
18- var path = Path . GetFullPath ( $ "{ Path . GetTempPath ( ) } /test_downloadFile.txt") ;
21+ if ( OperatingSystem . IsWindows ( ) )
22+ {
23+ var path = Path . GetFullPath ( $ "{ Path . GetTempPath ( ) } /test_downloadFile.txt") ;
1924
20- NetUtils . DownloadFile ( testDownloadFilePath , path ) ;
25+ NetUtils . DownloadFile ( testDownloadFilePath , path ) ;
2126
22- File . Delete ( path ) ;
27+ File . Delete ( path ) ;
28+ }
2329 }
2430
2531 [ TestMethod ]
2632 public void Test_WebDownloadFile ( )
2733 {
28- var path = Path . GetFullPath ( $ "{ Path . GetTempPath ( ) } /test_webDownloadFile.txt") ;
34+ if ( OperatingSystem . IsWindows ( ) )
35+ {
36+ var path = Path . GetFullPath ( $ "{ Path . GetTempPath ( ) } /test_webDownloadFile.txt") ;
2937
30- NetUtils . WebDownloadFile ( testDownloadFilePath , path ) ;
38+ NetUtils . WebDownloadFile ( testDownloadFilePath , path ) ;
3139
32- File . Delete ( path ) ;
40+ File . Delete ( path ) ;
41+ }
3342 }
3443}
You can’t perform that action at this time.
0 commit comments