summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test')
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/MockOpenIdExtension.cs9
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs8
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/RelyingPartySecuritySettingsTests.cs8
4 files changed, 16 insertions, 13 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockOpenIdExtension.cs b/src/DotNetOpenAuth.Test/Mocks/MockOpenIdExtension.cs
index d04e504..80b34a7 100644
--- a/src/DotNetOpenAuth.Test/Mocks/MockOpenIdExtension.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/MockOpenIdExtension.cs
@@ -48,6 +48,15 @@ namespace DotNetOpenAuth.Test.Mocks {
get { return Enumerable.Empty<string>(); }
}
+ /// <summary>
+ /// Gets or sets a value indicating whether this extension was
+ /// signed by the OpenID Provider.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is signed by the provider; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsSignedByProvider { get; set; }
+
#endregion
#region IMessage Properties
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
index 67f7a54..24c62e1 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
@@ -113,15 +113,17 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
/// Verifies that unsigned extension responses (where any or all fields are unsigned) are ignored.
/// </summary>
[TestMethod]
- public void UnsignedExtensionsAreIgnored() {
+ public void ExtensionsAreIdentifiedAsSignedOrUnsigned() {
Protocol protocol = Protocol.Default;
OpenIdCoordinator coordinator = new OpenIdCoordinator(
rp => {
RegisterMockExtension(rp.Channel);
var response = rp.Channel.ReadFromRequest<IndirectSignedResponse>();
- Assert.AreEqual(1, response.Extensions.Count, "Signed extension should have been received.");
+ Assert.AreEqual(1, response.SignedExtensions.Count(), "Signed extension should have been received.");
+ Assert.AreEqual(0, response.UnsignedExtensions.Count(), "No unsigned extension should be present.");
response = rp.Channel.ReadFromRequest<IndirectSignedResponse>();
- Assert.AreEqual(0, response.Extensions.Count, "Unsigned extension should have been ignored.");
+ Assert.AreEqual(0, response.SignedExtensions.Count(), "No signed extension should have been received.");
+ Assert.AreEqual(1, response.UnsignedExtensions.Count(), "Unsigned extension should have been received.");
},
op => {
RegisterMockExtension(op.Channel);
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs
index 7a18c8e..7701090 100644
--- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs
@@ -39,8 +39,8 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
Assert.IsNull(authResponse.Exception);
Assert.AreEqual<string>(assertion.ClaimedIdentifier, authResponse.ClaimedIdentifier);
Assert.AreEqual<string>(authResponseAccessor.endpoint.FriendlyIdentifierForDisplay, authResponse.FriendlyIdentifierForDisplay);
- Assert.AreSame(extension, authResponse.GetExtension(typeof(ClaimsResponse)));
- Assert.AreSame(extension, authResponse.GetExtension<ClaimsResponse>());
+ Assert.AreSame(extension, authResponse.GetUntrustedExtension(typeof(ClaimsResponse)));
+ Assert.AreSame(extension, authResponse.GetUntrustedExtension<ClaimsResponse>());
Assert.IsNull(authResponse.GetCallbackArgument("a"));
Assert.AreEqual(0, authResponse.GetCallbackArguments().Count);
}
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/RelyingPartySecuritySettingsTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/RelyingPartySecuritySettingsTests.cs
index 8c5dc6a..cb5fbb5 100644
--- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/RelyingPartySecuritySettingsTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/RelyingPartySecuritySettingsTests.cs
@@ -53,13 +53,5 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
this.settings.RequireSsl = !this.settings.RequireSsl;
Assert.IsTrue(requireSslChanged);
}
-
- /// <summary>
- /// Verifies default value for AllowUnsignedIncomingExtensions.
- /// </summary>
- [TestMethod]
- public void AllowUnsignedIncomingExtensionsDefault() {
- Assert.IsFalse(this.settings.AllowUnsignedIncomingExtensions);
- }
}
}