summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOAuth.Test/ConsumerDescription.cs11
-rw-r--r--src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs13
-rw-r--r--src/DotNetOAuth.Test/Scenarios/Coordinator.cs2
3 files changed, 19 insertions, 7 deletions
diff --git a/src/DotNetOAuth.Test/ConsumerDescription.cs b/src/DotNetOAuth.Test/ConsumerDescription.cs
index 2c73a72..c7158a4 100644
--- a/src/DotNetOAuth.Test/ConsumerDescription.cs
+++ b/src/DotNetOAuth.Test/ConsumerDescription.cs
@@ -9,6 +9,9 @@ namespace DotNetOAuth.Test {
/// Information necessary to initialize a <see cref="Consumer"/>,
/// and to tell a <see cref="ServiceProvider"/> about it.
/// </summary>
+ /// <remarks>
+ /// Immutable.
+ /// </remarks>
internal class ConsumerDescription {
/// <summary>
/// Initializes a new instance of the <see cref="ConsumerDescription"/> class.
@@ -21,15 +24,15 @@ namespace DotNetOAuth.Test {
}
/// <summary>
- /// Gets or sets the consumer key.
+ /// Gets the consumer key.
/// </summary>
/// <value>The consumer key.</value>
- internal string ConsumerKey { get; set; }
+ internal string ConsumerKey { get; private set; }
/// <summary>
- /// Gets or sets the consumer secret.
+ /// Gets the consumer secret.
/// </summary>
/// <value>The consumer secret.</value>
- internal string ConsumerSecret { get; set; }
+ internal string ConsumerSecret { get; private set; }
}
}
diff --git a/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs b/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
index 7f8c3b7..dbc7cd9 100644
--- a/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
+++ b/src/DotNetOAuth.Test/Mocks/InMemoryTokenManager.cs
@@ -82,10 +82,19 @@ namespace DotNetOAuth.Test.Mocks {
#endregion
- internal void AddConsumer(string key, string secret) {
- this.consumersAndSecrets.Add(key, secret);
+ /// <summary>
+ /// Tells a Service Provider's token manager about a consumer and its secret
+ /// so that the SP can verify the Consumer's signed messages.
+ /// </summary>
+ /// <param name="consumerDescription">The consumer description.</param>
+ internal void AddConsumer(ConsumerDescription consumerDescription) {
+ this.consumersAndSecrets.Add(consumerDescription.ConsumerKey, consumerDescription.ConsumerSecret);
}
+ /// <summary>
+ /// Marks an existing token as authorized.
+ /// </summary>
+ /// <param name="requestToken">The request token.</param>
internal void AuthorizeRequestToken(string requestToken) {
if (requestToken == null) {
throw new ArgumentNullException("requestToken");
diff --git a/src/DotNetOAuth.Test/Scenarios/Coordinator.cs b/src/DotNetOAuth.Test/Scenarios/Coordinator.cs
index a529653..9b48490 100644
--- a/src/DotNetOAuth.Test/Scenarios/Coordinator.cs
+++ b/src/DotNetOAuth.Test/Scenarios/Coordinator.cs
@@ -58,7 +58,7 @@ namespace DotNetOAuth.Test.Scenarios {
// Prepare token managers
InMemoryTokenManager consumerTokenManager = new InMemoryTokenManager();
InMemoryTokenManager serviceTokenManager = new InMemoryTokenManager();
- serviceTokenManager.AddConsumer(this.consumerDescription.ConsumerKey, this.consumerDescription.ConsumerSecret);
+ serviceTokenManager.AddConsumer(this.consumerDescription);
// Prepare channels that will pass messages directly back and forth.
CoordinatingOAuthChannel consumerChannel = new CoordinatingOAuthChannel(consumerSigningElement, true, consumerTokenManager);