diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs new file mode 100644 index 0000000..07f9bc9 --- /dev/null +++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs @@ -0,0 +1,34 @@ +//----------------------------------------------------------------------- +// <copyright file="CoordinatingOutgoingWebResponse.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.Test.Mocks { + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using DotNetOpenAuth.Messaging; + + internal class CoordinatingOutgoingWebResponse : OutgoingWebResponse { + private CoordinatingChannel receivingChannel; + + /// <summary> + /// Initializes a new instance of the <see cref="CoordinatingOutgoingWebResponse"/> class. + /// </summary> + /// <param name="message">The direct response message to send to the remote channel. This message will be cloned.</param> + /// <param name="receivingChannel">The receiving channel.</param> + internal CoordinatingOutgoingWebResponse(IProtocolMessage message, CoordinatingChannel receivingChannel) { + ErrorUtilities.VerifyArgumentNotNull(message, "message"); + ErrorUtilities.VerifyArgumentNotNull(receivingChannel, "receivingChannel"); + + this.receivingChannel = receivingChannel; + this.OriginalMessage = message; + } + + public override void Send() { + this.receivingChannel.PostMessage(this.OriginalMessage); + } + } +} |