@@ -15,7 +15,7 @@ public void TestGetDetails()
1515 IPinfoClient client = new IPinfoClient . Builder ( )
1616 . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
1717 . Build ( ) ;
18-
18+
1919 IPResponse actual = client . IPApi . GetDetails ( ip ) ;
2020
2121 var expectations = new List < Tuple < object , object > > ( )
@@ -43,7 +43,7 @@ public void TestGetDetails()
4343 Assert . False ( actual . Privacy . Vpn ) ;
4444 Assert . False ( actual . Privacy . Tor ) ;
4545 Assert . False ( actual . Privacy . Relay ) ;
46- Assert . True ( actual . Privacy . Hosting ) ;
46+ Assert . True ( actual . Privacy . Hosting ) ;
4747 }
4848
4949 [ Fact ]
@@ -53,11 +53,11 @@ public void TestBogonIPV4()
5353 IPinfoClient client = new IPinfoClient . Builder ( )
5454 . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
5555 . Build ( ) ;
56-
56+
5757 IPResponse actual = client . IPApi . GetDetails ( ip ) ;
5858
5959 Assert . Equal ( "127.0.0.1" , actual . IP ) ;
60- Assert . True ( actual . Bogon ) ;
60+ Assert . True ( actual . Bogon ) ;
6161 }
6262
6363 [ Fact ]
@@ -67,11 +67,11 @@ public void TestBogonIPV6()
6767 IPinfoClient client = new IPinfoClient . Builder ( )
6868 . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
6969 . Build ( ) ;
70-
70+
7171 IPResponse actual = client . IPApi . GetDetails ( ip ) ;
7272
7373 Assert . Equal ( "2001:0:c000:200::0:255:1" , actual . IP ) ;
74- Assert . True ( actual . Bogon ) ;
74+ Assert . True ( actual . Bogon ) ;
7575 }
7676
7777 [ Fact ]
@@ -81,11 +81,11 @@ public void TestNonBogonIPV4()
8181 IPinfoClient client = new IPinfoClient . Builder ( )
8282 . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
8383 . Build ( ) ;
84-
84+
8585 IPResponse actual = client . IPApi . GetDetails ( ip ) ;
8686
8787 Assert . Equal ( "1.1.1.1" , actual . IP ) ;
88- Assert . False ( actual . Bogon ) ;
88+ Assert . False ( actual . Bogon ) ;
8989 }
9090
9191 [ Fact ]
@@ -95,11 +95,43 @@ public void TestNonBogonIPV6()
9595 IPinfoClient client = new IPinfoClient . Builder ( )
9696 . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
9797 . Build ( ) ;
98-
98+
9999 IPResponse actual = client . IPApi . GetDetails ( ip ) ;
100100
101101 Assert . Equal ( "2a03:2880:f10a:83:face:b00c:0:25de" , actual . IP ) ;
102- Assert . False ( actual . Bogon ) ;
102+ Assert . False ( actual . Bogon ) ;
103+ }
104+
105+ [ Fact ]
106+ public void TestGetResproxy ( )
107+ {
108+ string ip = "175.107.211.204" ;
109+ IPinfoClient client = new IPinfoClient . Builder ( )
110+ . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
111+ . Build ( ) ;
112+
113+ IPResponseResproxy actual = client . IPApi . GetResproxy ( ip ) ;
114+
115+ Assert . Equal ( "175.107.211.204" , actual . IP ) ;
116+ Assert . NotNull ( actual . LastSeen ) ;
117+ Assert . NotNull ( actual . PercentDaysSeen ) ;
118+ Assert . NotNull ( actual . Service ) ;
119+ }
120+
121+ [ Fact ]
122+ public void TestGetResproxyNotFound ( )
123+ {
124+ string ip = "8.8.8.8" ;
125+ IPinfoClient client = new IPinfoClient . Builder ( )
126+ . AccessToken ( Environment . GetEnvironmentVariable ( "IPINFO_TOKEN" ) )
127+ . Build ( ) ;
128+
129+ IPResponseResproxy actual = client . IPApi . GetResproxy ( ip ) ;
130+
131+ Assert . Null ( actual . IP ) ;
132+ Assert . Null ( actual . LastSeen ) ;
133+ Assert . Null ( actual . PercentDaysSeen ) ;
134+ Assert . Null ( actual . Service ) ;
103135 }
104136 }
105137}
0 commit comments