File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ using NUnit . Framework ;
2
+ using System ;
3
+ using System . Collections . Generic ;
4
+ using System . Text ;
5
+ using Flow . Launcher . Infrastructure . UserSettings ;
6
+ using Flow . Launcher . Infrastructure . Http ;
7
+
8
+ namespace Flow . Launcher . Test
9
+ {
10
+ [ TestFixture ]
11
+ class HttpTest
12
+ {
13
+ [ Test ]
14
+ public void TestSettingUpdate ( )
15
+ {
16
+ HttpProxy proxy = new HttpProxy ( ) ;
17
+ Http . Proxy = proxy ;
18
+
19
+ proxy . Enabled = true ;
20
+ proxy . Server = "127.0.0.1" ;
21
+ Assert . AreEqual ( Http . WebProxy . Address , new Uri ( $ "http://{ proxy . Server } :{ proxy . Port } ") ) ;
22
+ Assert . IsNull ( Http . WebProxy . Credentials ) ;
23
+
24
+ proxy . UserName = "test" ;
25
+ Assert . NotNull ( Http . WebProxy . Credentials ) ;
26
+ Assert . AreEqual ( Http . WebProxy . Credentials . GetCredential ( Http . WebProxy . Address , "Basic" ) . UserName , proxy . UserName ) ;
27
+ Assert . AreEqual ( Http . WebProxy . Credentials . GetCredential ( Http . WebProxy . Address , "Basic" ) . Password , "" ) ;
28
+
29
+ proxy . Password = "test password" ;
30
+ Assert . AreEqual ( Http . WebProxy . Credentials . GetCredential ( Http . WebProxy . Address , "Basic" ) . Password , proxy . Password ) ;
31
+ }
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments