diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs index 5b9c3b0..2fc5348 100644 --- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs +++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// <copyright file="CoordinatingOAuthChannel.cs" company="Andrew Arnott"> +// <copyright file="CoordinatingOAuthConsumerChannel.cs" company="Andrew Arnott"> // Copyright (c) Andrew Arnott. All rights reserved. // </copyright> //----------------------------------------------------------------------- @@ -17,12 +17,12 @@ namespace DotNetOpenAuth.Test.Mocks { /// A special channel used in test simulations to pass messages directly between two parties. /// </summary> internal class CoordinatingOAuthConsumerChannel : OAuthConsumerChannel { - internal EventWaitHandle incomingMessageSignal = new AutoResetEvent(false); - internal IProtocolMessage incomingMessage; - internal OutgoingWebResponse incomingRawResponse; + private EventWaitHandle incomingMessageSignal = new AutoResetEvent(false); + private IProtocolMessage incomingMessage; + private OutgoingWebResponse incomingRawResponse; /// <summary> - /// Initializes a new instance of the <see cref="CoordinatingOAuthChannel"/> class for Consumers. + /// Initializes a new instance of the <see cref="CoordinatingOAuthConsumerChannel"/> class. /// </summary> /// <param name="signingBindingElement">The signing element for the Consumer to use. Null for the Service Provider.</param> /// <param name="tokenManager">The token manager to use.</param> @@ -35,6 +35,14 @@ namespace DotNetOpenAuth.Test.Mocks { securitySettings) { } + internal EventWaitHandle IncomingMessageSignal { + get { return this.incomingMessageSignal; } + } + + internal IProtocolMessage IncomingMessage { get; set; } + + internal OutgoingWebResponse IncomingRawResponse { get; set; } + /// <summary> /// Gets or sets the coordinating channel used by the other party. /// </summary> @@ -46,8 +54,8 @@ namespace DotNetOpenAuth.Test.Mocks { HttpRequestInfo requestInfo = this.SpoofHttpMethod(request); TestBase.TestLogger.InfoFormat("Sending protected resource request: {0}", requestInfo.Message); // Drop the outgoing message in the other channel's in-slot and let them know it's there. - this.RemoteChannel.incomingMessage = requestInfo.Message; - this.RemoteChannel.incomingMessageSignal.Set(); + this.RemoteChannel.IncomingMessage = requestInfo.Message; + this.RemoteChannel.IncomingMessageSignal.Set(); return this.AwaitIncomingRawResponse(); } @@ -59,15 +67,15 @@ namespace DotNetOpenAuth.Test.Mocks { protected override IProtocolMessage RequestCore(IDirectedProtocolMessage request) { HttpRequestInfo requestInfo = this.SpoofHttpMethod(request); // Drop the outgoing message in the other channel's in-slot and let them know it's there. - this.RemoteChannel.incomingMessage = requestInfo.Message; - this.RemoteChannel.incomingMessageSignal.Set(); + this.RemoteChannel.IncomingMessage = requestInfo.Message; + this.RemoteChannel.IncomingMessageSignal.Set(); // Now wait for a response... return this.AwaitIncomingMessage(); } protected override OutgoingWebResponse PrepareDirectResponse(IProtocolMessage response) { - this.RemoteChannel.incomingMessage = CloneSerializedParts(response, null); - this.RemoteChannel.incomingMessageSignal.Set(); + this.RemoteChannel.IncomingMessage = CloneSerializedParts(response, null); + this.RemoteChannel.IncomingMessageSignal.Set(); return new OutgoingWebResponse(); // not used, but returning null is not allowed } |