diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/RelyingParty')
4 files changed, 22 insertions, 22 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs index bf897b6..e73ec13 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs @@ -19,8 +19,8 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { [TestClass] public class AuthenticationRequestTests : OpenIdTestBase { - private readonly Realm realm = new Realm(TestSupport.GetFullUrl(TestSupport.ConsumerPage).AbsoluteUri); - private readonly Uri returnTo = TestSupport.GetFullUrl(TestSupport.ConsumerPage); + private readonly Realm realm = new Realm("http://localhost/rp.aspx"); + private readonly Uri returnTo = new Uri("http://localhost/rp.aspx"); private readonly Identifier claimedId = "http://claimedId"; private readonly Identifier delegatedLocalId = "http://localId"; private readonly Protocol protocol = Protocol.Default; @@ -70,7 +70,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { public void CreateRequestMessage() { OpenIdCoordinator coordinator = new OpenIdCoordinator( rp => { - Identifier id = this.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, ProtocolVersion.V20); + Identifier id = this.GetMockIdentifier(ProtocolVersion.V20); IAuthenticationRequest authRequest = rp.CreateRequest(id, this.realm, this.returnTo); // Add some callback arguments @@ -97,7 +97,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Assert.AreEqual(1, req.Extensions.Count); Assert.IsTrue(req.Extensions.Contains(sregRequest)); }, - TestSupport.AutoProvider); + AutoProvider); coordinator.Run(); } @@ -108,7 +108,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { public void Provider() { IAuthenticationRequest_Accessor authRequest = this.CreateAuthenticationRequest(this.claimedId, this.claimedId); Assert.IsNotNull(authRequest.Provider); - Assert.AreEqual(ProviderUri, authRequest.Provider.Uri); + Assert.AreEqual(OPUri, authRequest.Provider.Uri); Assert.AreEqual(this.protocol.Version, authRequest.Provider.Version); } @@ -122,7 +122,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { } private AuthenticationRequest_Accessor CreateAuthenticationRequest(Identifier claimedIdentifier, Identifier providerLocalIdentifier) { - ProviderEndpointDescription providerEndpoint = new ProviderEndpointDescription(ProviderUri, this.protocol.Version); + ProviderEndpointDescription providerEndpoint = new ProviderEndpointDescription(OPUri, this.protocol.Version); ServiceEndpoint endpoint = ServiceEndpoint.CreateForClaimedIdentifier(claimedIdentifier, providerLocalIdentifier, providerEndpoint, 10, 5); ServiceEndpoint_Accessor endpointAccessor = ServiceEndpoint_Accessor.AttachShadow(endpoint); OpenIdRelyingParty rp = this.CreateRelyingParty(); diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs index edcab87..d2a75de 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs @@ -25,8 +25,8 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { [TestMethod] public void CreateRequestDumbMode() { var rp = new OpenIdRelyingParty(null); - Identifier id = this.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, ProtocolVersion.V20); - var authReq = rp.CreateRequest(id, TestSupport.Realm, TestSupport.ReturnTo); + Identifier id = this.GetMockIdentifier(ProtocolVersion.V20); + var authReq = rp.CreateRequest(id, RPRealmUri, RPUri); CheckIdRequest requestMessage = (CheckIdRequest)authReq.RedirectingResponse.OriginalMessage; Assert.IsNull(requestMessage.AssociationHandle); } @@ -40,18 +40,18 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { [TestMethod] public void CreateRequest() { var rp = this.CreateRelyingParty(); - TestSupport.StoreAssociation(rp, TestSupport.GetFullUrl("/" + TestSupport.ProviderPage), HmacShaAssociation.Create("somehandle", new byte[20], TimeSpan.FromDays(1))); - Identifier id = Identifier.Parse(GetMockIdentifier(TestSupport.Scenarios.AutoApproval, ProtocolVersion.V20)); - var req = rp.CreateRequest(id, TestSupport.Realm, TestSupport.ReturnTo); + StoreAssociation(rp, OPUri, HmacShaAssociation.Create("somehandle", new byte[20], TimeSpan.FromDays(1))); + Identifier id = Identifier.Parse(GetMockIdentifier(ProtocolVersion.V20)); + var req = rp.CreateRequest(id, RPRealmUri, RPUri); Assert.IsNotNull(req); } [TestMethod] public void CreateRequests() { var rp = this.CreateRelyingParty(); - TestSupport.StoreAssociation(rp, TestSupport.GetFullUrl("/" + TestSupport.ProviderPage), HmacShaAssociation.Create("somehandle", new byte[20], TimeSpan.FromDays(1))); - Identifier id = Identifier.Parse(GetMockIdentifier(TestSupport.Scenarios.AutoApproval, ProtocolVersion.V20)); - var requests = rp.CreateRequests(id, TestSupport.Realm, TestSupport.ReturnTo); + StoreAssociation(rp, OPUri, HmacShaAssociation.Create("somehandle", new byte[20], TimeSpan.FromDays(1))); + Identifier id = Identifier.Parse(GetMockIdentifier(ProtocolVersion.V20)); + var requests = rp.CreateRequests(id, RPRealmUri, RPUri); Assert.AreEqual(1, requests.Count()); } @@ -60,7 +60,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Uri nonOpenId = new Uri("http://www.microsoft.com/"); var rp = this.CreateRelyingParty(); this.MockResponder.RegisterMockResponse(nonOpenId, "text/html", "<html/>"); - rp.CreateRequest(nonOpenId, TestSupport.Realm, TestSupport.ReturnTo); + rp.CreateRequest(nonOpenId, RPRealmUri, RPUri); } [TestMethod] @@ -68,7 +68,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Uri nonOpenId = new Uri("http://www.microsoft.com/"); var rp = this.CreateRelyingParty(); this.MockResponder.RegisterMockResponse(nonOpenId, "text/html", "<html/>"); - var requests = rp.CreateRequests(nonOpenId, TestSupport.Realm, TestSupport.ReturnTo); + var requests = rp.CreateRequests(nonOpenId, RPRealmUri, RPUri); Assert.AreEqual(0, requests.Count()); } } diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs index b3812ce..48473e0 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs @@ -15,8 +15,8 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { [TestClass] public class PositiveAuthenticationResponseTests : OpenIdTestBase { - private readonly Realm realm = new Realm(TestSupport.GetFullUrl(TestSupport.ConsumerPage).AbsoluteUri); - private readonly Uri returnTo = TestSupport.GetFullUrl(TestSupport.ConsumerPage); + private readonly Realm realm = new Realm("http://localhost/rp.aspx"); + private readonly Uri returnTo = new Uri("http://localhost/rp.aspx"); [TestInitialize] public override void SetUp() { @@ -61,10 +61,10 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { private PositiveAssertionResponse GetPositiveAssertion() { Protocol protocol = Protocol.Default; PositiveAssertionResponse assertion = new PositiveAssertionResponse(protocol.Version, this.returnTo); - assertion.ClaimedIdentifier = TestSupport.GetMockIdentifier(TestSupport.Scenarios.AutoApproval, this.MockResponder, protocol.ProtocolVersion); - assertion.LocalIdentifier = TestSupport.GetDelegateUrl(TestSupport.Scenarios.AutoApproval); + assertion.ClaimedIdentifier = this.GetMockIdentifier(protocol.ProtocolVersion, false); + assertion.LocalIdentifier = OPLocalIdentifiers[0]; assertion.ReturnTo = this.returnTo; - assertion.ProviderEndpoint = TestSupport.GetFullUrl("/" + TestSupport.ProviderPage, null, false); + assertion.ProviderEndpoint = OPUri; return assertion; } } diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs index c62549d..7b71eef 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/ServiceEndpointTests.cs @@ -205,7 +205,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Assert.IsFalse(se.IsExtensionSupported("http://someextension/typeuri")); ProviderEndpointDescription ped = new ProviderEndpointDescription( - ProviderUri, + OPUri, new[] { Protocol.V20.ClaimedIdentifierServiceTypeURI, "http://someextension", Constants.sreg_ns }); se = ServiceEndpoint.CreateForClaimedIdentifier(this.claimedXri, this.userSuppliedXri, this.localId, ped, this.servicePriority, this.uriPriority); Assert.IsTrue(se.IsExtensionSupported<ClaimsRequest>()); |