diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-05 18:57:45 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-05 18:57:45 -0800 |
commit | 935afb17553bde7ac32c5ec7abad3b34d94bae7c (patch) | |
tree | 4901e9e7e1e6b95a56b4d5c58f21dd5b6d4b7fdc | |
parent | d24fb316aa70134a9c2b1045b4b5f7d8277573b4 (diff) | |
download | DotNetOpenAuth-935afb17553bde7ac32c5ec7abad3b34d94bae7c.zip DotNetOpenAuth-935afb17553bde7ac32c5ec7abad3b34d94bae7c.tar.gz DotNetOpenAuth-935afb17553bde7ac32c5ec7abad3b34d94bae7c.tar.bz2 |
Fixed OpenID check_auth response message's is_valid value boolean casing to be lowercase.
Fixes Google Code Issue 211.
-rw-r--r-- | src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationResponseTests.cs | 14 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationResponseTests.cs index cf97aa3..ce55ea4 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationResponseTests.cs @@ -9,6 +9,9 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { using System.Collections.Generic; using System.Linq; using System.Text; + using DotNetOpenAuth.Messaging.Reflection; + using DotNetOpenAuth.OpenId; + using DotNetOpenAuth.OpenId.Messages; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] @@ -17,5 +20,16 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { public override void SetUp() { base.SetUp(); } + + [TestMethod] + public void IsValid() { + Protocol protocol = Protocol.Default; + var request = new CheckAuthenticationRequest(protocol.Version, OPUri); + var response = new CheckAuthenticationResponse(protocol.Version, request); + var dictionary = new MessageDictionary(response); + Assert.AreEqual("false", dictionary["is_valid"]); + response.IsValid = true; + Assert.AreEqual("true", dictionary["is_valid"]); + } } } diff --git a/src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs b/src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs index 3a1432a..1c3a37d 100644 --- a/src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs +++ b/src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs @@ -63,6 +63,7 @@ namespace DotNetOpenAuth.Messaging.Reflection { Map<byte[]>(bytes => Convert.ToBase64String(bytes), str => Convert.FromBase64String(str)); Map<Realm>(realm => realm.ToString(), str => new Realm(str)); Map<Identifier>(id => id.ToString(), str => Identifier.Parse(str)); + Map<bool>(value => value.ToString().ToLowerInvariant(), str => bool.Parse(str)); } /// <summary> |