diff options
Diffstat (limited to 'src/DotNetOAuth.Test/OAuthChannelTests.cs')
-rw-r--r-- | src/DotNetOAuth.Test/OAuthChannelTests.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/DotNetOAuth.Test/OAuthChannelTests.cs b/src/DotNetOAuth.Test/OAuthChannelTests.cs index 1e41832..1099dc6 100644 --- a/src/DotNetOAuth.Test/OAuthChannelTests.cs +++ b/src/DotNetOAuth.Test/OAuthChannelTests.cs @@ -7,12 +7,43 @@ namespace DotNetOAuth.Test {
using System;
using System.Collections.Generic;
- using System.Linq;
using System.Text;
using DotNetOAuth.Messaging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class OAuthChannelTests : TestBase {
+ private Channel channel;
+
+ [TestInitialize]
+ public override void SetUp() {
+ base.SetUp();
+
+ this.channel = new OAuthChannel();
+ }
+
+ [TestMethod, Ignore]
+ public void ReadFromRequestAuthorization() {
+ }
+
+ internal static string CreateAuthorizationHeader(IDictionary<string, string> fields) {
+ if (fields == null) {
+ throw new ArgumentNullException("fields");
+ }
+
+ StringBuilder authorization = new StringBuilder();
+ authorization.Append("OAuth ");
+ foreach (var pair in fields) {
+ string key = Uri.EscapeDataString(pair.Key);
+ string value = Uri.EscapeDataString(pair.Value);
+ authorization.Append(key);
+ authorization.Append("=\"");
+ authorization.Append(value);
+ authorization.Append("\",");
+ }
+ authorization.Length--; // remove trailing comma
+
+ return authorization.ToString();
+ }
}
}
|