summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs')
-rw-r--r--src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs b/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs
deleted file mode 100644
index 6c05434..0000000
--- a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="StandardExpirationBindingElementTests.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOAuth.Test.Messaging.Bindings {
- using System;
- using DotNetOAuth.Messaging;
- using DotNetOAuth.Messaging.Bindings;
- using DotNetOAuth.Test.Mocks;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
-
- [TestClass]
- public class StandardExpirationBindingElementTests : MessagingTestBase {
- [TestMethod]
- public void SendSetsTimestamp() {
- TestExpiringMessage message = new TestExpiringMessage(MessageTransport.Indirect);
- message.Recipient = new Uri("http://localtest");
- ((IExpiringProtocolMessage)message).UtcCreationDate = DateTime.Parse("1/1/1990");
-
- Channel channel = CreateChannel(MessageProtections.Expiration);
- channel.Send(message);
- Assert.IsTrue(DateTime.UtcNow - ((IExpiringProtocolMessage)message).UtcCreationDate < TimeSpan.FromSeconds(3), "The timestamp on the message was not set on send.");
- }
-
- [TestMethod]
- public void VerifyGoodTimestampIsAccepted() {
- this.Channel = CreateChannel(MessageProtections.Expiration);
- this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
- }
-
- [TestMethod, ExpectedException(typeof(ExpiredMessageException))]
- public void VerifyBadTimestampIsRejected() {
- this.Channel = CreateChannel(MessageProtections.Expiration);
- this.ParameterizedReceiveProtectedTest(DateTime.UtcNow - StandardExpirationBindingElement.DefaultMaximumMessageAge - TimeSpan.FromSeconds(1), false);
- }
- }
-}