summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-10-07 21:36:29 -0700
committerAndrew <andrewarnott@gmail.com>2008-10-07 21:36:29 -0700
commit29d897769f3e7a9568fa668836807d9a31b5fabc (patch)
treefb9a91e0804ed5a92d183268309ea0234732682b /src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
parent43188751fe5c64c8f29f62e448a2c6a798910328 (diff)
downloadDotNetOpenAuth-29d897769f3e7a9568fa668836807d9a31b5fabc.zip
DotNetOpenAuth-29d897769f3e7a9568fa668836807d9a31b5fabc.tar.gz
DotNetOpenAuth-29d897769f3e7a9568fa668836807d9a31b5fabc.tar.bz2
Added strong-typed request token message to sample.
This proves that messages can be derived from and tailored to provide type-safe additions where the OAuth protocol permits it. As can be seen, several more types and members had to be made public for this to work.
Diffstat (limited to 'src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs')
-rw-r--r--src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs b/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
index 87d7608..7f8c3b7 100644
--- a/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
+++ b/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
@@ -9,6 +9,7 @@ namespace DotNetOAuth.Test.Mocks {
using System.Collections.Generic;
using System.Diagnostics;
using DotNetOAuth.ChannelElements;
+ using DotNetOAuth.Messages;
internal class InMemoryTokenManager : ITokenManager {
private Dictionary<string, string> consumersAndSecrets = new Dictionary<string, string>();
@@ -34,9 +35,9 @@ namespace DotNetOAuth.Test.Mocks {
return this.tokensAndSecrets[token];
}
- public void StoreNewRequestToken(string consumerKey, string requestToken, string requestTokenSecret, IDictionary<string, string> requestParameters, IDictionary<string, string> responseParameters) {
- this.tokensAndSecrets[requestToken] = requestTokenSecret;
- this.requestTokens.Add(requestToken, false);
+ public void StoreNewRequestToken(RequestTokenMessage request, UnauthorizedRequestTokenMessage response) {
+ this.tokensAndSecrets[response.RequestToken] = response.TokenSecret;
+ this.requestTokens.Add(response.RequestToken, false);
}
/// <summary>