summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-07-04 20:00:45 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-07-04 20:00:45 -0700
commit5d1f7e810dd7169a75098e80031ae89926581042 (patch)
tree2cf93ba49c966f1bbe3136425dbb1187438049fe /src
parent0157899fa9ed427afcd88fc09aad54356f1e0b61 (diff)
downloadDotNetOpenAuth-5d1f7e810dd7169a75098e80031ae89926581042.zip
DotNetOpenAuth-5d1f7e810dd7169a75098e80031ae89926581042.tar.gz
DotNetOpenAuth-5d1f7e810dd7169a75098e80031ae89926581042.tar.bz2
Fixed tests.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Test/OAuth2/MessageFactoryTests.cs22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.Test/OAuth2/MessageFactoryTests.cs b/src/DotNetOpenAuth.Test/OAuth2/MessageFactoryTests.cs
index a3c2210..b6b8994 100644
--- a/src/DotNetOpenAuth.Test/OAuth2/MessageFactoryTests.cs
+++ b/src/DotNetOpenAuth.Test/OAuth2/MessageFactoryTests.cs
@@ -35,6 +35,7 @@ namespace DotNetOpenAuth.Test.OAuth2 {
[TestCase]
public void EndUserAuthorizationRequest() {
var fields = new Dictionary<string, string> {
+ { Protocol.response_type, "code" },
{ Protocol.client_id, "abc" },
{ Protocol.redirect_uri, "abc" },
};
@@ -43,10 +44,18 @@ namespace DotNetOpenAuth.Test.OAuth2 {
}
[TestCase]
- public void EndUserAuthorizationSuccessResponse() {
+ public void EndUserAuthorizationSuccessResponseWithCode() {
var fields = new Dictionary<string, string> {
- { Protocol.client_id, "abc" },
- { Protocol.redirect_uri, "abc" },
+ { Protocol.code, "abc" },
+ };
+ IDirectedProtocolMessage request = this.messageFactory.GetNewRequestMessage(this.recipient, fields);
+ Assert.IsInstanceOf(typeof(EndUserAuthorizationSuccessResponse), request);
+ }
+
+ [TestCase, Ignore("Not yet supported")]
+ public void EndUserAuthorizationSuccessResponseWithAccessToken() {
+ var fields = new Dictionary<string, string> {
+ { Protocol.access_token, "abc" },
};
IDirectedProtocolMessage request = this.messageFactory.GetNewRequestMessage(this.recipient, fields);
Assert.IsInstanceOf(typeof(EndUserAuthorizationSuccessResponse), request);
@@ -55,8 +64,7 @@ namespace DotNetOpenAuth.Test.OAuth2 {
[TestCase]
public void EndUserAuthorizationFailedResponse() {
var fields = new Dictionary<string, string> {
- { Protocol.client_id, "abc" },
- { Protocol.redirect_uri, "abc" },
+ { Protocol.error, "access-denied" },
};
IDirectedProtocolMessage request = this.messageFactory.GetNewRequestMessage(this.recipient, fields);
Assert.IsInstanceOf(typeof(EndUserAuthorizationFailedResponse), request);
@@ -69,6 +77,7 @@ namespace DotNetOpenAuth.Test.OAuth2 {
[TestCase]
public void AccessTokenRefreshRequest() {
var fields = new Dictionary<string, string> {
+ { Protocol.client_id, "abc" },
{ Protocol.refresh_token, "abc" },
{ Protocol.grant_type, "refresh-token" },
};
@@ -80,7 +89,9 @@ namespace DotNetOpenAuth.Test.OAuth2 {
public void AccessTokenAuthorizationCodeRequest() {
var fields = new Dictionary<string, string> {
{ Protocol.client_id, "abc" },
+ { Protocol.code, "code" },
{ Protocol.grant_type, "authorization-code" },
+ { Protocol.redirect_uri, "http://someUri" },
};
IDirectedProtocolMessage request = this.messageFactory.GetNewRequestMessage(this.recipient, fields);
Assert.IsInstanceOf(typeof(AccessTokenAuthorizationCodeRequest), request);
@@ -113,6 +124,7 @@ namespace DotNetOpenAuth.Test.OAuth2 {
[TestCase]
public void AccessTokenAssertionRequest() {
var fields = new Dictionary<string, string> {
+ { Protocol.client_id, "abc" },
{ Protocol.assertion_type, "abc" },
{ Protocol.assertion, "abc" },
{ Protocol.grant_type, "assertion" },