summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs')
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs b/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs
index 2b3249f..35d7f1b 100644
--- a/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/MockTransformationBindingElement.cs
@@ -9,11 +9,14 @@ namespace DotNetOpenAuth.Test.Mocks {
using System.Collections.Generic;
using System.Linq;
using System.Text;
+ using System.Threading;
+ using System.Threading.Tasks;
+
using DotNetOpenAuth.Messaging;
using NUnit.Framework;
internal class MockTransformationBindingElement : IChannelBindingElement {
- private string transform;
+ private readonly string transform;
internal MockTransformationBindingElement(string transform) {
if (transform == null) {
@@ -34,25 +37,25 @@ namespace DotNetOpenAuth.Test.Mocks {
/// </summary>
public Channel Channel { get; set; }
- MessageProtections? IChannelBindingElement.ProcessOutgoingMessage(IProtocolMessage message) {
+ Task<MessageProtections?> IChannelBindingElement.ProcessOutgoingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
var testMessage = message as TestMessage;
if (testMessage != null) {
testMessage.Name = this.transform + testMessage.Name;
- return MessageProtections.None;
+ return MessageProtectionTasks.None;
}
- return null;
+ return MessageProtectionTasks.Null;
}
- MessageProtections? IChannelBindingElement.ProcessIncomingMessage(IProtocolMessage message) {
+ Task<MessageProtections?> IChannelBindingElement.ProcessIncomingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
var testMessage = message as TestMessage;
if (testMessage != null) {
StringAssert.StartsWith(this.transform, testMessage.Name);
testMessage.Name = testMessage.Name.Substring(this.transform.Length);
- return MessageProtections.None;
+ return MessageProtectionTasks.None;
}
- return null;
+ return MessageProtectionTasks.Null;
}
#endregion