summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-11-24 07:17:36 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-11-24 07:17:36 -0800
commitf9b24ff007ee1739fa204c1055a887b9ed519cea (patch)
tree33c579af8c920c7924ef221db8798bb071c4fabf /src/DotNetOpenAuth.Test/OpenId
parent17705cbe5575b7364005fd21fce4ef1d9fe7f946 (diff)
downloadDotNetOpenAuth-f9b24ff007ee1739fa204c1055a887b9ed519cea.zip
DotNetOpenAuth-f9b24ff007ee1739fa204c1055a887b9ed519cea.tar.gz
DotNetOpenAuth-f9b24ff007ee1739fa204c1055a887b9ed519cea.tar.bz2
Fixed up failing unit tests.
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionsInteropHelperRPRequestTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs6
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs10
5 files changed, 10 insertions, 14 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs b/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
index 4432c0d..a9d2f56 100644
--- a/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
@@ -337,7 +337,7 @@ namespace DotNetOpenAuth.Test.OpenId {
op.SendResponse(req);
});
coordinator.IncomingMessageFilter = message => {
- Assert.AreSame(Protocol.Lookup(opDescription.Version).ProtocolVersion, message.Version, "The message was recognized as version {0} but was expected to be {1}.", message.Version, Protocol.Lookup(opDescription.Version).ProtocolVersion);
+ Assert.AreSame(opDescription.Version, message.Version, "The message was recognized as version {0} but was expected to be {1}.", message.Version, Protocol.Lookup(opDescription.Version).ProtocolVersion);
var associateSuccess = message as AssociateSuccessfulResponse;
var associateFailed = message as AssociateUnsuccessfulResponse;
if (associateSuccess != null) {
@@ -348,7 +348,7 @@ namespace DotNetOpenAuth.Test.OpenId {
}
};
coordinator.OutgoingMessageFilter = message => {
- Assert.AreSame(Protocol.Lookup(opDescription.Version).ProtocolVersion, message.Version, "The message was for version {0} but was expected to be for {1}.", message.Version, Protocol.Lookup(opDescription.Version).Version);
+ Assert.AreEqual(opDescription.Version, message.Version, "The message was for version {0} but was expected to be for {1}.", message.Version, opDescription.Version);
};
coordinator.Run();
diff --git a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs
index 404f37d..9247bb6 100644
--- a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/XriDiscoveryProxyServiceTests.cs
@@ -56,7 +56,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices {
string expectedCanonicalId = "=!9B72.7DD1.50A9.5CCD";
IdentifierDiscoveryResult se = this.VerifyCanonicalId("=Arnott", expectedCanonicalId);
- Assert.AreEqual(Protocol.V10, Protocol.Lookup(se.Version).ProtocolVersion);
+ Assert.AreEqual(Protocol.V10, Protocol.Lookup(se.Version));
Assert.AreEqual("http://1id.com/sso", se.ProviderEndpoint.ToString());
Assert.AreEqual(se.ClaimedIdentifier, se.ProviderLocalIdentifier);
Assert.AreEqual("=Arnott", se.FriendlyIdentifierForDisplay);
diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionsInteropHelperRPRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionsInteropHelperRPRequestTests.cs
index 447d49e..ea960b5 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionsInteropHelperRPRequestTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionsInteropHelperRPRequestTests.cs
@@ -119,7 +119,7 @@ namespace DotNetOpenAuth.Test.OpenId {
/// </summary>
/// <param name="typeUri">The type URI.</param>
private void InjectAdvertisedTypeUri(string typeUri) {
- var serviceEndpoint = ProviderEndpointDescription_Accessor.AttachShadow(this.authReq.Provider);
+ var serviceEndpoint = IdentifierDiscoveryResult_Accessor.AttachShadow(this.authReq.Provider);
serviceEndpoint.Capabilities = new ReadOnlyCollection<string>(
serviceEndpoint.Capabilities.Concat(new[] { typeUri }).ToList());
}
diff --git a/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs b/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs
index f80bd35..60cd25f 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs
@@ -6,6 +6,7 @@
namespace DotNetOpenAuth.Test.OpenId {
using System;
+ using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
using DotNetOpenAuth.OpenId.Messages;
@@ -18,5 +19,10 @@ namespace DotNetOpenAuth.Test.OpenId {
var epd = new ProviderEndpointDescription(OPUri, Protocol.Default.Version);
Assert.IsNotNull(epd.Capabilities);
}
+
+ [TestMethod, ExpectedException(typeof(ProtocolException))]
+ public void ProtocolDetectionWithoutClues() {
+ new ProviderEndpointDescription(OPUri, new[] { Protocol.V20.HtmlDiscoveryLocalIdKey }); // random type URI irrelevant to detection
+ }
}
}
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs
index a7d9752..81b3bdb 100644
--- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs
@@ -69,16 +69,6 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
Assert.AreSame(Protocol.V11, se.Protocol);
}
- [TestMethod, ExpectedException(typeof(ProtocolException))]
- public void ProtocolDetectionWithoutClues() {
- IdentifierDiscoveryResult se = IdentifierDiscoveryResult.CreateForClaimedIdentifier(
- this.claimedId,
- this.localId,
- new ProviderEndpointDescription(this.providerEndpoint, new[] { Protocol.V20.HtmlDiscoveryLocalIdKey }), // random type URI irrelevant to detection
- this.servicePriority,
- this.uriPriority);
- }
-
[TestMethod]
public void EqualsTests() {
IdentifierDiscoveryResult se = IdentifierDiscoveryResult.CreateForClaimedIdentifier(this.claimedId, this.localId, new ProviderEndpointDescription(this.providerEndpoint, this.v20TypeUris), this.servicePriority, this.uriPriority);