summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-03-21 07:07:13 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2013-03-21 07:07:13 -0700
commit579703ee02408e7d3cdd604aa263e95a6f1e49c3 (patch)
tree902569579db8c71de10bed7e2797ae8e5a735060 /src/DotNetOpenAuth.Test/OpenId
parentb53f5530fe1adbd5dccd6ff2743e8e2ba512eba2 (diff)
downloadDotNetOpenAuth-579703ee02408e7d3cdd604aa263e95a6f1e49c3.zip
DotNetOpenAuth-579703ee02408e7d3cdd604aa263e95a6f1e49c3.tar.gz
DotNetOpenAuth-579703ee02408e7d3cdd604aa263e95a6f1e49c3.tar.bz2
Moves the rest of the static methods out.
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs12
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs2
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/NonIdentityTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs8
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Provider/HostProcessedRequestTests.cs8
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs6
9 files changed, 25 insertions, 25 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs b/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
index 4f0bed8..99fa56c 100644
--- a/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/AssociationHandshakeTests.cs
@@ -245,7 +245,7 @@ namespace DotNetOpenAuth.Test.OpenId {
public async Task RPOnlyRenegotiatesOnce() {
Protocol protocol = Protocol.V20;
int opStep = 0;
- await CoordinatorBase.RunAsync(
+ await RunAsync(
RelyingPartyDriver(async (rp, ct) => {
var association = await rp.AssociationManager.GetOrCreateAssociationAsync(new ProviderEndpointDescription(OPUri, protocol.Version), ct);
Assert.IsNull(association, "The RP should quietly give up when the OP misbehaves.");
@@ -350,7 +350,7 @@ namespace DotNetOpenAuth.Test.OpenId {
relyingParty.SecuritySettings = this.RelyingPartySecuritySettings;
rpAssociation = await relyingParty.AssociationManager.GetOrCreateAssociationAsync(opDescription, ct);
},
- CoordinatorBase.Handle(opDescription.Uri).By(async (request, ct) => {
+ Handle(opDescription.Uri).By(async (request, ct) => {
IRequest req = await provider.GetRequestAsync(request, ct);
Assert.IsNotNull(req, "Expected incoming request but did not receive it.");
Assert.IsTrue(req.IsResponseReady);
diff --git a/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs b/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
index cb12e77..93f74e6 100644
--- a/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
@@ -77,13 +77,13 @@ namespace DotNetOpenAuth.Test.OpenId {
}
}
},
- CoordinatorBase.Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
+ Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore(), hostFactories);
IAuthenticationResponse response = await rp.GetResponseAsync();
Assert.AreEqual(AuthenticationStatus.Authenticated, response.Status);
return new HttpResponseMessage();
}),
- CoordinatorBase.Handle(OPUri).By(
+ Handle(OPUri).By(
async (req, ct) => {
var op = new OpenIdProvider(opStore);
return await this.AutoProviderActionAsync(op, req, ct);
@@ -106,14 +106,14 @@ namespace DotNetOpenAuth.Test.OpenId {
}
}
},
- CoordinatorBase.Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
+ Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore(), hostFactories);
rp.SecuritySettings.RejectUnsolicitedAssertions = true;
IAuthenticationResponse response = await rp.GetResponseAsync(req, ct);
Assert.AreEqual(AuthenticationStatus.Failed, response.Status);
return new HttpResponseMessage();
}),
- CoordinatorBase.Handle(OPUri).By(async (hostFactories, req, ct) => {
+ Handle(OPUri).By(async (hostFactories, req, ct) => {
var op = new OpenIdProvider(opStore);
return await this.AutoProviderActionAsync(op, req, ct);
}),
@@ -139,14 +139,14 @@ namespace DotNetOpenAuth.Test.OpenId {
}
}
},
- CoordinatorBase.Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
+ Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore(), hostFactories);
rp.SecuritySettings.RejectDelegatingIdentifiers = true;
IAuthenticationResponse response = await rp.GetResponseAsync(req, ct);
Assert.AreEqual(AuthenticationStatus.Failed, response.Status);
return new HttpResponseMessage();
}),
- CoordinatorBase.Handle(OPUri).By(async (hostFactories, req, ct) => {
+ Handle(OPUri).By(async (hostFactories, req, ct) => {
var op = new OpenIdProvider(opStore);
return await this.AutoProviderActionAsync(op, req, ct);
}),
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
index ca9b0a7..7a1add2 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
@@ -142,7 +142,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
}
}
},
- CoordinatorBase.Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
+ Handle(RPRealmUri).By(async (hostFactories, req, ct) => {
var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore(), hostFactories);
RegisterMockExtension(rp.Channel);
@@ -164,7 +164,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
return new HttpResponseMessage();
}),
- CoordinatorBase.Handle(OPUri).By(async (hostFactories, req, ct) => {
+ Handle(OPUri).By(async (hostFactories, req, ct) => {
var op = new OpenIdProvider(opStore);
return await AutoProviderActionAsync(op, req, ct);
}));
diff --git a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs
index e75afb8..06cb745 100644
--- a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs
@@ -112,7 +112,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices {
HttpUtility.HtmlEncode(insecureXrdsSource),
HttpUtility.HtmlEncode(OPUriSsl.AbsoluteUri),
HttpUtility.HtmlEncode(OPLocalIdentifiersSsl[1].AbsoluteUri));
- this.HostFactories.Handlers.Add(CoordinatorBase.Handle(VanityUriSsl).By(html, "text/html"));
+ this.HostFactories.Handlers.Add(Handle(VanityUriSsl).By(html, "text/html"));
Identifier userSuppliedIdentifier = new UriIdentifier(VanityUriSsl, true);
diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs
index 057abb3..7c7f945 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs
@@ -41,7 +41,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions {
var cryptoKeyStore = new MemoryCryptoKeyStore();
var associationStore = new ProviderAssociationHandleEncoder(cryptoKeyStore);
Association association = HmacShaAssociationProvider.Create(protocol, protocol.Args.SignatureAlgorithm.Best, AssociationRelyingPartyType.Smart, associationStore, securitySettings);
- await CoordinatorBase.RunAsync(
+ await TestBase.RunAsync(
OpenIdTestBase.RelyingPartyDriver(async (rp, ct) => {
RegisterExtension(rp.Channel, Mocks.MockOpenIdExtension.Factory);
var requestBase = new CheckIdRequest(protocol.Version, OpenIdTestBase.OPUri, AuthenticationRequestMode.Immediate);
diff --git a/src/DotNetOpenAuth.Test/OpenId/NonIdentityTests.cs b/src/DotNetOpenAuth.Test/OpenId/NonIdentityTests.cs
index 8764e69..16c096f 100644
--- a/src/DotNetOpenAuth.Test/OpenId/NonIdentityTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/NonIdentityTests.cs
@@ -23,7 +23,7 @@ namespace DotNetOpenAuth.Test.OpenId {
Protocol protocol = Protocol.V20;
var mode = AuthenticationRequestMode.Setup;
- await CoordinatorBase.RunAsync(
+ await RunAsync(
RelyingPartyDriver(async (rp, ct) => {
var request = new SignedResponseRequest(protocol.Version, OPUri, mode);
var authRequest = await rp.Channel.PrepareResponseAsync(request);
@@ -44,7 +44,7 @@ namespace DotNetOpenAuth.Test.OpenId {
public async Task ExtensionOnlyFacadeLevel() {
Protocol protocol = Protocol.V20;
int opStep = 0;
- await CoordinatorBase.RunAsync(
+ await RunAsync(
RelyingPartyDriver(async (rp, ct) => {
var request = await rp.CreateRequestAsync(GetMockIdentifier(protocol.ProtocolVersion), RPRealmUri, RPUri, ct);
diff --git a/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs b/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs
index d3b8aa0..f4a9684 100644
--- a/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/OpenIdTestBase.cs
@@ -141,9 +141,9 @@ namespace DotNetOpenAuth.Test.OpenId {
/// <remarks>
/// This is a very useful method to pass to the OpenIdCoordinator constructor for the Provider argument.
/// </remarks>
- internal CoordinatorBase.Handler AutoProvider {
+ internal TestBase.Handler AutoProvider {
get {
- return CoordinatorBase.Handle(OPUri).By(
+ return Handle(OPUri).By(
async (req, ct) => {
var provider = new OpenIdProvider(new StandardProviderApplicationStore());
return await this.AutoProviderActionAsync(provider, req, ct);
@@ -264,8 +264,8 @@ namespace DotNetOpenAuth.Test.OpenId {
};
}
- internal static CoordinatorBase.Handler HandleProvider(Func<OpenIdProvider, HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> provider) {
- return CoordinatorBase.Handle(OPUri).By(async (req, ct) => {
+ protected internal static Handler HandleProvider(Func<OpenIdProvider, HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> provider) {
+ return Handle(OPUri).By(async (req, ct) => {
var op = new OpenIdProvider(new StandardProviderApplicationStore());
return await provider(op, req, ct);
});
diff --git a/src/DotNetOpenAuth.Test/OpenId/Provider/HostProcessedRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Provider/HostProcessedRequestTests.cs
index 966e712..dc692fc 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Provider/HostProcessedRequestTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Provider/HostProcessedRequestTests.cs
@@ -41,7 +41,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider {
[Test]
public async Task IsReturnUrlDiscoverableValidResponse() {
- await CoordinatorBase.RunAsync(
+ await RunAsync(
async (hostFactories, ct) => {
this.request = new AuthenticationRequest(this.provider, this.checkIdRequest);
Assert.AreEqual(RelyingPartyDiscoveryResult.Success, await this.request.IsReturnUrlDiscoverableAsync(this.provider.Channel.HostFactories, CancellationToken.None));
@@ -55,7 +55,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider {
/// </summary>
[Test]
public async Task IsReturnUrlDiscoverableNotSsl() {
- await CoordinatorBase.RunAsync(
+ await RunAsync(
async (hostFactories, ct) => {
this.provider.SecuritySettings.RequireSsl = true;
Assert.AreEqual(RelyingPartyDiscoveryResult.NoServiceDocument, await this.request.IsReturnUrlDiscoverableAsync(this.provider.Channel.HostFactories, CancellationToken.None));
@@ -68,7 +68,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider {
/// </summary>
[Test]
public async Task IsReturnUrlDiscoverableRequireSsl() {
- await CoordinatorBase.RunAsync(
+ await RunAsync(
async (hostFactories, ct) => {
this.checkIdRequest.Realm = RPRealmUriSsl;
this.checkIdRequest.ReturnTo = RPUriSsl;
@@ -88,7 +88,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider {
[Test]
public async Task IsReturnUrlDiscoverableValidButNoMatch() {
- await CoordinatorBase.RunAsync(
+ await RunAsync(
async (hostFactories, ct) => {
this.provider.SecuritySettings.RequireSsl = false; // reset for another failure test case
this.checkIdRequest.ReturnTo = new Uri("http://somerandom/host");
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs
index 1dc5678..c2c5db5 100644
--- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs
@@ -94,7 +94,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
async (rp, ct) => {
await rp.CreateRequestAsync(nonOpenId, RPRealmUri, RPUri);
}),
- CoordinatorBase.Handle(nonOpenId).By("<html/>", "text/html"));
+ Handle(nonOpenId).By("<html/>", "text/html"));
await coordinator.RunAsync();
}
@@ -107,7 +107,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
var requests = await rp.CreateRequestsAsync(nonOpenId, RPRealmUri, RPUri);
Assert.AreEqual(0, requests.Count());
}),
- CoordinatorBase.Handle(nonOpenId).By("<html/>", "text/html"));
+ Handle(nonOpenId).By("<html/>", "text/html"));
await coordinator.RunAsync();
}
@@ -129,7 +129,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
}
}
},
- CoordinatorBase.Handle(RPRealmUri).By(
+ Handle(RPRealmUri).By(
async (hostFactories, req, ct) => {
var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore());