diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-05 16:04:35 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-05 16:04:35 -0800 |
commit | c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2 (patch) | |
tree | e3c41cfcd6bb9c905b2648ea08cda7ca0c6edd4a /src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs | |
parent | f02074e93cd1a1bd8b5b013c51fe26c0fb332bc6 (diff) | |
download | DotNetOpenAuth-c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2.zip DotNetOpenAuth-c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2.tar.gz DotNetOpenAuth-c282f35b8ccab78f6782d17c4ffab2b1ed96e5d2.tar.bz2 |
Added OpenID Provider downlevel protection for 1.x Relying Parties and turning it on by default.
Diffstat (limited to 'src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs b/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs index e5710c3..eaf59e0 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs @@ -40,13 +40,13 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { /// </summary> [TestMethod] public void RandomCharactersTest() { - Assert.IsTrue(this.nonceElement.PrepareMessageForSending(this.message)); + Assert.IsNotNull(this.nonceElement.PrepareMessageForSending(this.message)); Assert.IsNotNull(this.message.Nonce, "No nonce was set on the message."); Assert.AreNotEqual(0, this.message.Nonce.Length, "The generated nonce was empty."); string firstNonce = this.message.Nonce; // Apply another nonce and verify that they are different than the first ones. - Assert.IsTrue(this.nonceElement.PrepareMessageForSending(this.message)); + Assert.IsNotNull(this.nonceElement.PrepareMessageForSending(this.message)); Assert.IsNotNull(this.message.Nonce, "No nonce was set on the message."); Assert.AreNotEqual(0, this.message.Nonce.Length, "The generated nonce was empty."); Assert.AreNotEqual(firstNonce, this.message.Nonce, "The two generated nonces are identical."); @@ -58,7 +58,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { [TestMethod] public void ValidMessageReceivedTest() { this.message.Nonce = "a"; - Assert.IsTrue(this.nonceElement.PrepareMessageForReceiving(this.message)); + Assert.IsNotNull(this.nonceElement.PrepareMessageForReceiving(this.message)); } /// <summary> @@ -68,7 +68,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { public void ValidMessageNoNonceReceivedTest() { this.message.Nonce = string.Empty; this.nonceElement.AllowZeroLengthNonce = true; - Assert.IsTrue(this.nonceElement.PrepareMessageForReceiving(this.message)); + Assert.IsNotNull(this.nonceElement.PrepareMessageForReceiving(this.message)); } /// <summary> @@ -78,7 +78,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { public void InvalidMessageNoNonceReceivedTest() { this.message.Nonce = string.Empty; this.nonceElement.AllowZeroLengthNonce = false; - Assert.IsTrue(this.nonceElement.PrepareMessageForReceiving(this.message)); + Assert.IsNotNull(this.nonceElement.PrepareMessageForReceiving(this.message)); } /// <summary> @@ -87,7 +87,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { [TestMethod, ExpectedException(typeof(ReplayedMessageException))] public void ReplayDetectionTest() { this.message.Nonce = "a"; - Assert.IsTrue(this.nonceElement.PrepareMessageForReceiving(this.message)); + Assert.IsNotNull(this.nonceElement.PrepareMessageForReceiving(this.message)); // Now receive the same message again. This should throw because it's a message replay. this.nonceElement.PrepareMessageForReceiving(this.message); |