File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1010using System . ComponentModel . DataAnnotations ;
1111using System . Data ;
1212using System . Globalization ;
13+ using System . Net ;
1314using System . Reflection ;
1415using UnitTest . Components ;
1516
@@ -742,6 +743,23 @@ public void FormatIp_Test()
742743 Assert . Equal ( "192.168.1.###" , result ) ;
743744 }
744745
746+ [ Fact ]
747+ public void ConvertToIPAddress_Ok ( )
748+ {
749+ var ex = Assert . Throws < ArgumentNullException > ( ( ) => Utility . ConvertToIPAddress ( "" ) ) ;
750+ Assert . NotNull ( ex ) ;
751+
752+ var address = Utility . ConvertToIPAddress ( "any" ) ;
753+ Assert . Equal ( IPAddress . Any , address ) ;
754+ }
755+
756+ [ Fact ]
757+ public void ConvertToIpEndPoint_Ok ( )
758+ {
759+ var ex = Assert . Throws < ArgumentOutOfRangeException > ( ( ) => Utility . ConvertToIpEndPoint ( "localhost" , 88990 ) ) ;
760+ Assert . NotNull ( ex ) ;
761+ }
762+
745763 [ AutoGenerateClass ( Align = Alignment . Center ) ]
746764 private class Dog
747765 {
You can’t perform that action at this time.
0 commit comments