summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/TestUtilities.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-04-20 19:43:19 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2012-04-20 19:43:19 -0700
commitdd8ace7ab2b1b51ebd4fb5f04fb9b5e30bfe4493 (patch)
treeb9792d82bb3de9fa66a4e429b8f7dd2c23ad8cfe /src/DotNetOpenAuth.Test/TestUtilities.cs
parentbd0de8217763d02759815b91588cd578becf496b (diff)
parent6da931cf632ccbfdab0b44b9ffd45ed7ff19c308 (diff)
downloadDotNetOpenAuth-dd8ace7ab2b1b51ebd4fb5f04fb9b5e30bfe4493.zip
DotNetOpenAuth-dd8ace7ab2b1b51ebd4fb5f04fb9b5e30bfe4493.tar.gz
DotNetOpenAuth-dd8ace7ab2b1b51ebd4fb5f04fb9b5e30bfe4493.tar.bz2
Adds extensibility points for authenticating OAuth 2 clients at the client and authorization server ends.
Fixes #105 Related to #75
Diffstat (limited to 'src/DotNetOpenAuth.Test/TestUtilities.cs')
-rw-r--r--src/DotNetOpenAuth.Test/TestUtilities.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Test/TestUtilities.cs b/src/DotNetOpenAuth.Test/TestUtilities.cs
index cf9b5a3..a526f7f 100644
--- a/src/DotNetOpenAuth.Test/TestUtilities.cs
+++ b/src/DotNetOpenAuth.Test/TestUtilities.cs
@@ -7,16 +7,35 @@
namespace DotNetOpenAuth.Test {
using System;
using System.Collections.Generic;
+ using System.Collections.Specialized;
using System.Linq;
+ using System.Net;
using log4net;
/// <summary>
/// An assortment of methods useful for testing.
/// </summary>
- internal class TestUtilities {
+ internal static class TestUtilities {
/// <summary>
/// The logger that tests should use.
/// </summary>
internal static readonly ILog TestLogger = LogManager.GetLogger("DotNetOpenAuth.Test");
+
+ internal static void ApplyTo(this NameValueCollection source, NameValueCollection target) {
+ Requires.NotNull(source, "source");
+ Requires.NotNull(target, "target");
+
+ foreach (string header in source) {
+ target[header] = source[header];
+ }
+ }
+
+ internal static T Clone<T>(this T source) where T : NameValueCollection, new() {
+ Requires.NotNull(source, "source");
+
+ var result = new T();
+ ApplyTo(source, result);
+ return result;
+ }
}
}