summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationResponseTests.cs14
-rw-r--r--src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs1
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>