@@ -16,12 +16,13 @@ public class AuthenticationTests
16
16
public void Can_Authenticate_With_Basic_Http_Auth ( )
17
17
{
18
18
Uri baseUrl = new Uri ( "http://localhost:8888/" ) ;
19
+
19
20
using ( SimpleServer . Create ( baseUrl . AbsoluteUri , UsernamePasswordEchoHandler ) )
20
21
{
21
22
var client = new RestClient ( baseUrl )
22
- {
23
- Authenticator = new HttpBasicAuthenticator ( "testuser" , "testpassword" )
24
- } ;
23
+ {
24
+ Authenticator = new HttpBasicAuthenticator ( "testuser" , "testpassword" )
25
+ } ;
25
26
var request = new RestRequest ( "test" ) ;
26
27
var response = client . Execute ( request ) ;
27
28
@@ -78,6 +79,7 @@ public void Can_Authenticate_With_OAuth()
78
79
qs = HttpUtility . ParseQueryString ( response . Content ) ;
79
80
oauthToken = qs [ "oauth_token" ] ;
80
81
oauthTokenSecret = qs [ "oauth_token_secret" ] ;
82
+
81
83
Assert . NotNull ( oauthToken ) ;
82
84
Assert . NotNull ( oauthTokenSecret ) ;
83
85
@@ -96,7 +98,9 @@ public void Can_Authenticate_With_OAuth()
96
98
//{
97
99
// var baseUrl = "http://term.ie/oauth/example";
98
100
// var client = new RestClient(baseUrl);
101
+
99
102
// client.Authenticator = new OAuthAuthenticator(baseUrl, "key", "secret");
103
+
100
104
// var request = new RestRequest("request_token.php");
101
105
// var response = client.Execute(request);
102
106
@@ -109,7 +113,9 @@ public void Can_Authenticate_With_OAuth()
109
113
//{
110
114
// var baseUrl = "http://term.ie/oauth/example";
111
115
// var client = new RestClient(baseUrl);
116
+
112
117
// client.Authenticator = new OAuthAuthenticator(baseUrl, "key", "secret", "requestkey", "requestsecret");
118
+
113
119
// var request = new RestRequest("access_token.php");
114
120
// var response = client.Execute(request);
115
121
@@ -123,10 +129,14 @@ public void Can_Authenticate_With_OAuth()
123
129
//{
124
130
// var baseUrl = "http://term.ie/oauth/example";
125
131
// var client = new RestClient(baseUrl);
132
+
126
133
// client.Authenticator = new OAuthAuthenticator(baseUrl, "key", "secret", "accesskey", "accesssecret");
134
+
127
135
// var request = new RestRequest("echo_api.php");
136
+
128
137
// request.AddParameter("foo", "bar");
129
138
// request.AddParameter("fizz", "pop");
139
+
130
140
// var response = client.Execute(request);
131
141
132
142
// Assert.NotNull(response);
@@ -138,7 +148,9 @@ public void Can_Authenticate_With_OAuth()
138
148
//{
139
149
// var baseUrl = "http://term.ie/oauth/example";
140
150
// var client = new RestClient(baseUrl);
151
+
141
152
// client.Authenticator = new OAuthAuthenticator(baseUrl, "key", "secret", "accesskey", "accesssecret");
153
+
142
154
// var request = new RestRequest("echo_api.php");
143
155
// var response = client.Execute(request);
144
156
0 commit comments