summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/CoordinatorBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/CoordinatorBase.cs')
-rw-r--r--src/DotNetOpenAuth.Test/CoordinatorBase.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/CoordinatorBase.cs b/src/DotNetOpenAuth.Test/CoordinatorBase.cs
index 83b9e6e..0afa232 100644
--- a/src/DotNetOpenAuth.Test/CoordinatorBase.cs
+++ b/src/DotNetOpenAuth.Test/CoordinatorBase.cs
@@ -13,8 +13,11 @@ namespace DotNetOpenAuth.Test {
using System.Threading;
using System.Threading.Tasks;
using DotNetOpenAuth.Messaging;
+ using DotNetOpenAuth.OpenId.Provider;
using DotNetOpenAuth.OpenId.RelyingParty;
using DotNetOpenAuth.Test.Mocks;
+ using DotNetOpenAuth.Test.OpenId;
+
using NUnit.Framework;
using Validation;
@@ -43,6 +46,20 @@ namespace DotNetOpenAuth.Test {
return new Handler(uri);
}
+ internal static Func<IHostFactories, CancellationToken, Task> RelyingPartyDriver(Func<OpenIdRelyingParty, CancellationToken, Task> relyingPartyDriver) {
+ return async (hostFactories, ct) => {
+ var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore(), hostFactories);
+ await relyingPartyDriver(rp, ct);
+ };
+ }
+
+ internal static Handler HandleProvider(Func<OpenIdProvider, HttpRequestMessage, CancellationToken, Task<HttpResponseMessage> provider) {
+ return Handle(OpenIdTestBase.OPUri).By(async (req, ct) => {
+ var op = new OpenIdProvider(new StandardProviderApplicationStore());
+ return await provider(op, req, ct);
+ });
+ }
+
internal struct Handler {
internal Handler(Uri uri)
: this() {