@@ -64,6 +64,29 @@ public void HttpProxy_SystemProxy_Loaded(string rawProxyString, bool hasInsecure
6464 } , rawProxyString , hasInsecureProxy . ToString ( ) , hasSecureProxy . ToString ( ) ) . Dispose ( ) ;
6565 }
6666
67+ [ Theory ]
68+ [ InlineData ( "localhost:1234" , "http://localhost:1234/" ) ]
69+ [ InlineData ( "123.123.123.123" , "http://123.123.123.123/" ) ]
70+ public void HttpProxy_SystemProxy_Loaded ( string rawProxyString , string expectedUri )
71+ {
72+ RemoteInvoke ( ( proxyString , expectedString ) =>
73+ {
74+ IWebProxy p ;
75+
76+ FakeRegistry . Reset ( ) ;
77+
78+ FakeRegistry . WinInetProxySettings . Proxy = proxyString ;
79+ WinInetProxyHelper proxyHelper = new WinInetProxyHelper ( ) ;
80+
81+ Assert . True ( HttpSystemProxy . TryCreate ( out p ) ) ;
82+ Assert . NotNull ( p ) ;
83+ Assert . Equal ( expectedString , p . GetProxy ( new Uri ( fooHttp ) ) . ToString ( ) ) ;
84+ Assert . Equal ( expectedString , p . GetProxy ( new Uri ( fooHttps ) ) . ToString ( ) ) ;
85+
86+ return SuccessExitCode ;
87+ } , rawProxyString , expectedUri ) . Dispose ( ) ;
88+ }
89+
6790 [ Theory ]
6891 [ InlineData ( "http://localhost/" , true ) ]
6992 [ InlineData ( "http://127.0.0.1/" , true ) ]
@@ -144,7 +167,6 @@ public void HttpProxy_Local_Parsing(string bypass, int count)
144167 [ InlineData ( "http://;" ) ]
145168 [ InlineData ( "http=;" ) ]
146169 [ InlineData ( " ; " ) ]
147- [ InlineData ( "proxy.contoso.com" ) ]
148170 public void HttpProxy_InvalidSystemProxy_Null ( string rawProxyString )
149171 {
150172 RemoteInvoke ( ( proxyString ) =>
0 commit comments