diff options
Diffstat (limited to 'src/DotNetOAuth.Test')
19 files changed, 79 insertions, 79 deletions
diff --git a/src/DotNetOAuth.Test/ChannelElements/OAuthChannelTests.cs b/src/DotNetOAuth.Test/ChannelElements/OAuthChannelTests.cs index d847726..7a03859 100644 --- a/src/DotNetOAuth.Test/ChannelElements/OAuthChannelTests.cs +++ b/src/DotNetOAuth.Test/ChannelElements/OAuthChannelTests.cs @@ -68,17 +68,17 @@ namespace DotNetOAuth.Test.ChannelElements { [TestMethod]
public void ReadFromRequestAuthorization() {
- this.ParameterizedReceiveTest(HttpDeliveryMethod.AuthorizationHeaderRequest);
+ this.ParameterizedReceiveTest(HttpDeliveryMethods.AuthorizationHeaderRequest);
}
[TestMethod]
public void ReadFromRequestForm() {
- this.ParameterizedReceiveTest(HttpDeliveryMethod.PostRequest);
+ this.ParameterizedReceiveTest(HttpDeliveryMethods.PostRequest);
}
[TestMethod]
public void ReadFromRequestQueryString() {
- this.ParameterizedReceiveTest(HttpDeliveryMethod.GetRequest);
+ this.ParameterizedReceiveTest(HttpDeliveryMethods.GetRequest);
}
[TestMethod]
@@ -144,23 +144,23 @@ namespace DotNetOAuth.Test.ChannelElements { public void RequestBadPreferredScheme() {
TestDirectedMessage message = new TestDirectedMessage(MessageTransport.Direct);
message.Recipient = new Uri("http://localtest");
- message.HttpMethods = HttpDeliveryMethod.None;
+ message.HttpMethods = HttpDeliveryMethods.None;
this.channel.Request(message);
}
[TestMethod]
public void RequestUsingAuthorizationHeader() {
- this.ParameterizedRequestTest(HttpDeliveryMethod.AuthorizationHeaderRequest);
+ this.ParameterizedRequestTest(HttpDeliveryMethods.AuthorizationHeaderRequest);
}
[TestMethod]
public void RequestUsingGet() {
- this.ParameterizedRequestTest(HttpDeliveryMethod.GetRequest);
+ this.ParameterizedRequestTest(HttpDeliveryMethods.GetRequest);
}
[TestMethod]
public void RequestUsingPost() {
- this.ParameterizedRequestTest(HttpDeliveryMethod.PostRequest);
+ this.ParameterizedRequestTest(HttpDeliveryMethods.PostRequest);
}
private static string CreateAuthorizationHeader(IDictionary<string, string> fields) {
@@ -183,14 +183,14 @@ namespace DotNetOAuth.Test.ChannelElements { return authorization.ToString();
}
- private static HttpRequestInfo CreateHttpRequestInfo(HttpDeliveryMethod scheme, IDictionary<string, string> fields) {
+ private static HttpRequestInfo CreateHttpRequestInfo(HttpDeliveryMethods scheme, IDictionary<string, string> fields) {
string query = MessagingUtilities.CreateQueryString(fields);
UriBuilder requestUri = new UriBuilder("http://localhost/path");
WebHeaderCollection headers = new WebHeaderCollection();
MemoryStream ms = new MemoryStream();
string method;
switch (scheme) {
- case HttpDeliveryMethod.PostRequest:
+ case HttpDeliveryMethods.PostRequest:
method = "POST";
headers.Add(HttpRequestHeader.ContentType, "application/x-www-form-urlencoded");
StreamWriter sw = new StreamWriter(ms);
@@ -198,11 +198,11 @@ namespace DotNetOAuth.Test.ChannelElements { sw.Flush();
ms.Position = 0;
break;
- case HttpDeliveryMethod.GetRequest:
+ case HttpDeliveryMethods.GetRequest:
method = "GET";
requestUri.Query = query;
break;
- case HttpDeliveryMethod.AuthorizationHeaderRequest:
+ case HttpDeliveryMethods.AuthorizationHeaderRequest:
method = "GET";
headers.Add(HttpRequestHeader.Authorization, CreateAuthorizationHeader(fields));
break;
@@ -229,7 +229,7 @@ namespace DotNetOAuth.Test.ChannelElements { return info;
}
- private void ParameterizedRequestTest(HttpDeliveryMethod scheme) {
+ private void ParameterizedRequestTest(HttpDeliveryMethods scheme) {
TestDirectedMessage request = new TestDirectedMessage(MessageTransport.Direct) {
Age = 15,
Name = "Andrew",
@@ -243,7 +243,7 @@ namespace DotNetOAuth.Test.ChannelElements { this.webRequestHandler.Callback = (req) => {
Assert.IsNotNull(req);
HttpRequestInfo reqInfo = ConvertToRequestInfo(req, this.webRequestHandler.RequestEntityStream);
- Assert.AreEqual(scheme == HttpDeliveryMethod.PostRequest ? "POST" : "GET", reqInfo.HttpMethod);
+ Assert.AreEqual(scheme == HttpDeliveryMethods.PostRequest ? "POST" : "GET", reqInfo.HttpMethod);
var incomingMessage = this.channel.ReadFromRequest(reqInfo) as TestMessage;
Assert.IsNotNull(incomingMessage);
Assert.AreEqual(request.Age, incomingMessage.Age);
@@ -272,7 +272,7 @@ namespace DotNetOAuth.Test.ChannelElements { Assert.AreEqual(request.Location, responseMessage.Location);
}
- private void ParameterizedReceiveTest(HttpDeliveryMethod scheme) {
+ private void ParameterizedReceiveTest(HttpDeliveryMethods scheme) {
var fields = new Dictionary<string, string> {
{ "age", "15" },
{ "Name", "Andrew" },
diff --git a/src/DotNetOAuth.Test/ChannelElements/PlainTextSigningBindingElementTest.cs b/src/DotNetOAuth.Test/ChannelElements/PlaintextSigningBindingElementTest.cs index ef27e94..7bf9e63 100644 --- a/src/DotNetOAuth.Test/ChannelElements/PlainTextSigningBindingElementTest.cs +++ b/src/DotNetOAuth.Test/ChannelElements/PlaintextSigningBindingElementTest.cs @@ -1,5 +1,5 @@ //-----------------------------------------------------------------------
-// <copyright file="PlainTextSigningBindingElementTest.cs" company="Andrew Arnott">
+// <copyright file="PlaintextSigningBindingElementTest.cs" company="Andrew Arnott">
// Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
@@ -12,11 +12,11 @@ namespace DotNetOAuth.Test.ChannelElements using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
- public class PlainTextSigningBindingElementTest {
+ public class PlaintextSigningBindingElementTest {
[TestMethod]
public void HttpsSignatureGeneration() {
- SigningBindingElementBase target = new PlainTextSigningBindingElement();
- MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://localtest", HttpDeliveryMethod.GetRequest);
+ SigningBindingElementBase target = new PlaintextSigningBindingElement();
+ MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://localtest", HttpDeliveryMethods.GetRequest);
ITamperResistantOAuthMessage message = new GetRequestTokenMessage(endpoint);
message.ConsumerSecret = "cs";
message.TokenSecret = "ts";
@@ -27,8 +27,8 @@ namespace DotNetOAuth.Test.ChannelElements [TestMethod]
public void HttpsSignatureVerification() {
- MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://localtest", HttpDeliveryMethod.GetRequest);
- ITamperProtectionChannelBindingElement target = new PlainTextSigningBindingElement();
+ MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://localtest", HttpDeliveryMethods.GetRequest);
+ ITamperProtectionChannelBindingElement target = new PlaintextSigningBindingElement();
ITamperResistantOAuthMessage message = new GetRequestTokenMessage(endpoint);
message.ConsumerSecret = "cs";
message.TokenSecret = "ts";
@@ -39,8 +39,8 @@ namespace DotNetOAuth.Test.ChannelElements [TestMethod]
public void HttpsSignatureVerificationNotApplicable() {
- SigningBindingElementBase target = new PlainTextSigningBindingElement();
- MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://localtest", HttpDeliveryMethod.GetRequest);
+ SigningBindingElementBase target = new PlaintextSigningBindingElement();
+ MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://localtest", HttpDeliveryMethods.GetRequest);
ITamperResistantOAuthMessage message = new GetRequestTokenMessage(endpoint);
message.ConsumerSecret = "cs";
message.TokenSecret = "ts";
@@ -51,8 +51,8 @@ namespace DotNetOAuth.Test.ChannelElements [TestMethod]
public void HttpSignatureGeneration() {
- SigningBindingElementBase target = new PlainTextSigningBindingElement();
- MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("http://localtest", HttpDeliveryMethod.GetRequest);
+ SigningBindingElementBase target = new PlaintextSigningBindingElement();
+ MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("http://localtest", HttpDeliveryMethods.GetRequest);
ITamperResistantOAuthMessage message = new GetRequestTokenMessage(endpoint);
message.ConsumerSecret = "cs";
message.TokenSecret = "ts";
@@ -65,8 +65,8 @@ namespace DotNetOAuth.Test.ChannelElements [TestMethod]
public void HttpSignatureVerification() {
- SigningBindingElementBase target = new PlainTextSigningBindingElement();
- MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("http://localtest", HttpDeliveryMethod.GetRequest);
+ SigningBindingElementBase target = new PlaintextSigningBindingElement();
+ MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("http://localtest", HttpDeliveryMethods.GetRequest);
ITamperResistantOAuthMessage message = new GetRequestTokenMessage(endpoint);
message.ConsumerSecret = "cs";
message.TokenSecret = "ts";
diff --git a/src/DotNetOAuth.Test/ChannelElements/SigningBindingElementBaseTests.cs b/src/DotNetOAuth.Test/ChannelElements/SigningBindingElementBaseTests.cs index 0ce116c..6759bc6 100644 --- a/src/DotNetOAuth.Test/ChannelElements/SigningBindingElementBaseTests.cs +++ b/src/DotNetOAuth.Test/ChannelElements/SigningBindingElementBaseTests.cs @@ -23,7 +23,7 @@ namespace DotNetOAuth.Test.ChannelElements { }
internal static GetRequestTokenMessage CreateTestRequestTokenMessage() {
- MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://www.google.com/accounts/OAuthGetRequestToken", HttpDeliveryMethod.AuthorizationHeaderRequest | HttpDeliveryMethod.GetRequest);
+ MessageReceivingEndpoint endpoint = new MessageReceivingEndpoint("https://www.google.com/accounts/OAuthGetRequestToken", HttpDeliveryMethods.AuthorizationHeaderRequest | HttpDeliveryMethods.GetRequest);
GetRequestTokenMessage message = new GetRequestTokenMessage(endpoint);
message.ConsumerKey = "nerdbank.org";
((ITamperResistantOAuthMessage)message).ConsumerSecret = "nerdbanksecret";
diff --git a/src/DotNetOAuth.Test/DotNetOAuth.Test.csproj b/src/DotNetOAuth.Test/DotNetOAuth.Test.csproj index 35af966..14a1a39 100644 --- a/src/DotNetOAuth.Test/DotNetOAuth.Test.csproj +++ b/src/DotNetOAuth.Test/DotNetOAuth.Test.csproj @@ -89,7 +89,7 @@ <Compile Include="Mocks\TestChannel.cs" />
<Compile Include="Mocks\TestMessage.cs" />
<Compile Include="Mocks\TestMessageTypeProvider.cs" />
- <Compile Include="ChannelElements\PlainTextSigningBindingElementTest.cs" />
+ <Compile Include="ChannelElements\PlaintextSigningBindingElementTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Messaging\ResponseTests.cs" />
<Compile Include="ProtocolTests.cs" />
diff --git a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs b/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs index bbef6f2..6c05434 100644 --- a/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs +++ b/src/DotNetOAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs @@ -19,20 +19,20 @@ namespace DotNetOAuth.Test.Messaging.Bindings { message.Recipient = new Uri("http://localtest");
((IExpiringProtocolMessage)message).UtcCreationDate = DateTime.Parse("1/1/1990");
- Channel channel = CreateChannel(MessageProtection.Expiration);
+ Channel channel = CreateChannel(MessageProtections.Expiration);
channel.Send(message);
Assert.IsTrue(DateTime.UtcNow - ((IExpiringProtocolMessage)message).UtcCreationDate < TimeSpan.FromSeconds(3), "The timestamp on the message was not set on send.");
}
[TestMethod]
public void VerifyGoodTimestampIsAccepted() {
- this.Channel = CreateChannel(MessageProtection.Expiration);
+ this.Channel = CreateChannel(MessageProtections.Expiration);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
[TestMethod, ExpectedException(typeof(ExpiredMessageException))]
public void VerifyBadTimestampIsRejected() {
- this.Channel = CreateChannel(MessageProtection.Expiration);
+ this.Channel = CreateChannel(MessageProtections.Expiration);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow - StandardExpirationBindingElement.DefaultMaximumMessageAge - TimeSpan.FromSeconds(1), false);
}
}
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs index 9caa10d..e142c82 100644 --- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs +++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs @@ -205,26 +205,26 @@ namespace DotNetOAuth.Test.Messaging { TestReplayProtectedMessage message = new TestReplayProtectedMessage(MessageTransport.Indirect);
message.Recipient = new Uri("http://localtest");
- this.Channel = CreateChannel(MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtections.ReplayProtection);
this.Channel.Send(message);
Assert.IsNotNull(((IReplayProtectedProtocolMessage)message).Nonce);
}
[TestMethod, ExpectedException(typeof(InvalidSignatureException))]
public void ReceivedInvalidSignature() {
- this.Channel = CreateChannel(MessageProtection.TamperProtection);
+ this.Channel = CreateChannel(MessageProtections.TamperProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, true);
}
[TestMethod]
public void ReceivedReplayProtectedMessageJustOnce() {
- this.Channel = CreateChannel(MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtections.ReplayProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
[TestMethod, ExpectedException(typeof(ReplayedMessageException))]
public void ReceivedReplayProtectedMessageTwice() {
- this.Channel = CreateChannel(MessageProtection.ReplayProtection);
+ this.Channel = CreateChannel(MessageProtections.ReplayProtection);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
}
@@ -277,7 +277,7 @@ namespace DotNetOAuth.Test.Messaging { [TestMethod, ExpectedException(typeof(UnprotectedMessageException))]
public void InsufficientlyProtectedMessageReceived() {
- this.Channel = CreateChannel(MessageProtection.None, MessageProtection.TamperProtection);
+ this.Channel = CreateChannel(MessageProtections.None, MessageProtections.TamperProtection);
this.ParameterizedReceiveProtectedTest(DateTime.Now, false);
}
diff --git a/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs b/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs index aa4f350..403cd25 100644 --- a/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs +++ b/src/DotNetOAuth.Test/Messaging/MessagingTestBase.cs @@ -78,30 +78,30 @@ namespace DotNetOAuth.Test { return request;
}
- internal static Channel CreateChannel(MessageProtection capabilityAndRecognition) {
+ internal static Channel CreateChannel(MessageProtections capabilityAndRecognition) {
return CreateChannel(capabilityAndRecognition, capabilityAndRecognition);
}
- internal static Channel CreateChannel(MessageProtection capability, MessageProtection recognition) {
+ internal static Channel CreateChannel(MessageProtections capability, MessageProtections recognition) {
var bindingElements = new List<IChannelBindingElement>();
- if (capability >= MessageProtection.TamperProtection) {
+ if (capability >= MessageProtections.TamperProtection) {
bindingElements.Add(new MockSigningBindingElement());
}
- if (capability >= MessageProtection.Expiration) {
+ if (capability >= MessageProtections.Expiration) {
bindingElements.Add(new StandardExpirationBindingElement());
}
- if (capability >= MessageProtection.ReplayProtection) {
+ if (capability >= MessageProtections.ReplayProtection) {
bindingElements.Add(new MockReplayProtectionBindingElement());
}
bool signing = false, expiration = false, replay = false;
- if (recognition >= MessageProtection.TamperProtection) {
+ if (recognition >= MessageProtections.TamperProtection) {
signing = true;
}
- if (recognition >= MessageProtection.Expiration) {
+ if (recognition >= MessageProtections.Expiration) {
expiration = true;
}
- if (recognition >= MessageProtection.ReplayProtection) {
+ if (recognition >= MessageProtections.ReplayProtection) {
replay = true;
}
diff --git a/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs b/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs index 805ace5..ffd6044 100644 --- a/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs +++ b/src/DotNetOAuth.Test/Mocks/MockReplayProtectionBindingElement.cs @@ -14,8 +14,8 @@ namespace DotNetOAuth.Test.Mocks { #region IChannelBindingElement Members
- MessageProtection IChannelBindingElement.Protection {
- get { return MessageProtection.ReplayProtection; }
+ MessageProtections IChannelBindingElement.Protection {
+ get { return MessageProtections.ReplayProtection; }
}
bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
diff --git a/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs b/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs index 58fa96c..97298ad 100644 --- a/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs +++ b/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs @@ -17,8 +17,8 @@ namespace DotNetOAuth.Test.Mocks { #region IChannelBindingElement Members
- MessageProtection IChannelBindingElement.Protection {
- get { return MessageProtection.TamperProtection; }
+ MessageProtections IChannelBindingElement.Protection {
+ get { return MessageProtections.TamperProtection; }
}
bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
diff --git a/src/DotNetOAuth.Test/Mocks/MockTransformationBindingElement.cs b/src/DotNetOAuth.Test/Mocks/MockTransformationBindingElement.cs index a569754..8ee6036 100644 --- a/src/DotNetOAuth.Test/Mocks/MockTransformationBindingElement.cs +++ b/src/DotNetOAuth.Test/Mocks/MockTransformationBindingElement.cs @@ -25,8 +25,8 @@ namespace DotNetOAuth.Test.Mocks { #region IChannelBindingElement Members
- MessageProtection IChannelBindingElement.Protection {
- get { return MessageProtection.None; }
+ MessageProtections IChannelBindingElement.Protection {
+ get { return MessageProtections.None; }
}
bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
diff --git a/src/DotNetOAuth.Test/Mocks/TestBaseMessage.cs b/src/DotNetOAuth.Test/Mocks/TestBaseMessage.cs index 29a0035..c874d23 100644 --- a/src/DotNetOAuth.Test/Mocks/TestBaseMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestBaseMessage.cs @@ -18,21 +18,21 @@ namespace DotNetOAuth.Test.Mocks { internal class TestBaseMessage : IProtocolMessage, IBaseMessageExplicitMembers {
private Dictionary<string, string> extraData = new Dictionary<string, string>();
- [MessagePart(Name = "age", IsRequired = true)]
+ [MessagePart("age", IsRequired = true)]
public int Age { get; set; }
[MessagePart]
public string Name { get; set; }
- [MessagePart(Name = "explicit")]
+ [MessagePart("explicit")]
string IBaseMessageExplicitMembers.ExplicitProperty { get; set; }
Version IProtocolMessage.ProtocolVersion {
get { return new Version(1, 0); }
}
- MessageProtection IProtocolMessage.RequiredProtection {
- get { return MessageProtection.None; }
+ MessageProtections IProtocolMessage.RequiredProtection {
+ get { return MessageProtections.None; }
}
MessageTransport IProtocolMessage.Transport {
@@ -48,7 +48,7 @@ namespace DotNetOAuth.Test.Mocks { set { this.PrivateProperty = value; }
}
- [MessagePart(Name = "private")]
+ [MessagePart("private")]
private string PrivateProperty { get; set; }
void IProtocolMessage.EnsureValidMessage() { }
diff --git a/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs b/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs index 8906151..1973463 100644 --- a/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs @@ -24,7 +24,7 @@ namespace DotNetOAuth.Test.Mocks { #region IProtocolMessage Properties
- MessageProtection IProtocolMessage.RequiredProtection {
+ MessageProtections IProtocolMessage.RequiredProtection {
get { return this.RequiredProtection; }
}
@@ -32,12 +32,12 @@ namespace DotNetOAuth.Test.Mocks { #region IOAuthDirectedMessage Members
- public HttpDeliveryMethod HttpMethods { get; internal set; }
+ public HttpDeliveryMethods HttpMethods { get; internal set; }
#endregion
- protected virtual MessageProtection RequiredProtection {
- get { return MessageProtection.None; }
+ protected virtual MessageProtections RequiredProtection {
+ get { return MessageProtections.None; }
}
}
}
diff --git a/src/DotNetOAuth.Test/Mocks/TestExpiringMessage.cs b/src/DotNetOAuth.Test/Mocks/TestExpiringMessage.cs index 19102a9..b14d4f2 100644 --- a/src/DotNetOAuth.Test/Mocks/TestExpiringMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestExpiringMessage.cs @@ -24,7 +24,7 @@ namespace DotNetOAuth.Test.Mocks { #region IExpiringProtocolMessage Members
- [MessagePart(Name = "created_on", IsRequired = true)]
+ [MessagePart("created_on", IsRequired = true)]
DateTime IExpiringProtocolMessage.UtcCreationDate {
get { return this.utcCreationDate; }
set { this.utcCreationDate = value.ToUniversalTime(); }
diff --git a/src/DotNetOAuth.Test/Mocks/TestMessage.cs b/src/DotNetOAuth.Test/Mocks/TestMessage.cs index 33086f8..0cb331c 100644 --- a/src/DotNetOAuth.Test/Mocks/TestMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestMessage.cs @@ -23,13 +23,13 @@ namespace DotNetOAuth.Test.Mocks { this.transport = transport;
}
- [MessagePart(Name = "age", IsRequired = true)]
+ [MessagePart("age", IsRequired = true)]
public int Age { get; set; }
[MessagePart("Name")]
public string Name { get; set; }
[MessagePart]
public string EmptyMember { get; set; }
- [MessagePart(Name = null)] // null name tests that Location is still the name.
+ [MessagePart(null)] // null name tests that Location is still the name.
public Uri Location { get; set; }
[MessagePart(IsRequired = true)]
public DateTime Timestamp { get; set; }
@@ -40,8 +40,8 @@ namespace DotNetOAuth.Test.Mocks { get { return new Version(1, 0); }
}
- MessageProtection IProtocolMessage.RequiredProtection {
- get { return MessageProtection.None; }
+ MessageProtections IProtocolMessage.RequiredProtection {
+ get { return MessageProtections.None; }
}
MessageTransport IProtocolMessage.Transport {
diff --git a/src/DotNetOAuth.Test/Mocks/TestReplayProtectedMessage.cs b/src/DotNetOAuth.Test/Mocks/TestReplayProtectedMessage.cs index 2a8bf9e..6467ebc 100644 --- a/src/DotNetOAuth.Test/Mocks/TestReplayProtectedMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestReplayProtectedMessage.cs @@ -19,7 +19,7 @@ namespace DotNetOAuth.Test.Mocks { #region IReplayProtectedProtocolMessage Members
- [MessagePart(Name = "Nonce")]
+ [MessagePart("Nonce")]
string IReplayProtectedProtocolMessage.Nonce {
get;
set;
diff --git a/src/DotNetOAuth.Test/Mocks/TestSignedDirectedMessage.cs b/src/DotNetOAuth.Test/Mocks/TestSignedDirectedMessage.cs index 2a52b2e..0cb880d 100644 --- a/src/DotNetOAuth.Test/Mocks/TestSignedDirectedMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestSignedDirectedMessage.cs @@ -26,8 +26,8 @@ namespace DotNetOAuth.Test.Mocks { #endregion
- protected override MessageProtection RequiredProtection {
- get { return MessageProtection.TamperProtection; }
+ protected override MessageProtections RequiredProtection {
+ get { return MessageProtections.TamperProtection; }
}
}
}
diff --git a/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs b/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs index afa49a3..71d0606 100644 --- a/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs +++ b/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs @@ -20,15 +20,15 @@ namespace DotNetOAuth.Test { [TestMethod]
public void SpecAppendixAExample() {
ServiceProviderDescription serviceDescription = new ServiceProviderDescription() {
- RequestTokenEndpoint = new MessageReceivingEndpoint("https://photos.example.net/request_token", HttpDeliveryMethod.PostRequest),
- UserAuthorizationEndpoint = new MessageReceivingEndpoint("http://photos.example.net/authorize", HttpDeliveryMethod.GetRequest),
- AccessTokenEndpoint = new MessageReceivingEndpoint("https://photos.example.net/access_token", HttpDeliveryMethod.PostRequest),
+ RequestTokenEndpoint = new MessageReceivingEndpoint("https://photos.example.net/request_token", HttpDeliveryMethods.PostRequest),
+ UserAuthorizationEndpoint = new MessageReceivingEndpoint("http://photos.example.net/authorize", HttpDeliveryMethods.GetRequest),
+ AccessTokenEndpoint = new MessageReceivingEndpoint("https://photos.example.net/access_token", HttpDeliveryMethods.PostRequest),
TamperProtectionElements = new ITamperProtectionChannelBindingElement[] {
- new PlainTextSigningBindingElement(),
+ new PlaintextSigningBindingElement(),
new HmacSha1SigningBindingElement(),
},
};
- MessageReceivingEndpoint accessPhotoEndpoint = new MessageReceivingEndpoint("http://photos.example.net/photos?file=vacation.jpg&size=original", HttpDeliveryMethod.AuthorizationHeaderRequest | HttpDeliveryMethod.GetRequest);
+ MessageReceivingEndpoint accessPhotoEndpoint = new MessageReceivingEndpoint("http://photos.example.net/photos?file=vacation.jpg&size=original", HttpDeliveryMethods.AuthorizationHeaderRequest | HttpDeliveryMethods.GetRequest);
ConsumerDescription consumerDescription = new ConsumerDescription("dpf43f3p2l4k3l03", "kd94hf93k423kf44");
Coordinator coordinator = new Coordinator(
diff --git a/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs b/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs index d5dddcf..60f216e 100644 --- a/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs +++ b/src/DotNetOAuth.Test/Scenarios/CoordinatingOAuthChannel.cs @@ -36,7 +36,7 @@ namespace DotNetOAuth.Test.Scenarios { signingBindingElement,
new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge),
tokenManager,
- isConsumer ? (IMessageTypeProvider)new OAuthConsumerMessageTypeProvider(tokenManager) : new OAuthServiceProviderMessageTypeProvider(tokenManager),
+ isConsumer ? (IMessageTypeProvider)new OAuthConsumerMessageTypeProvider() : new OAuthServiceProviderMessageTypeProvider(tokenManager),
new TestWebRequestHandler()) {
}
@@ -139,8 +139,8 @@ namespace DotNetOAuth.Test.Scenarios { return (T)serializer.Deserialize(serializer.Serialize(message), recipient);
}
- private string GetHttpMethod(HttpDeliveryMethod methods) {
- return (methods & HttpDeliveryMethod.PostRequest) != 0 ? "POST" : "GET";
+ private string GetHttpMethod(HttpDeliveryMethods methods) {
+ return (methods & HttpDeliveryMethods.PostRequest) != 0 ? "POST" : "GET";
}
}
}
diff --git a/src/DotNetOAuth.Test/ServiceProviderDescriptionTests.cs b/src/DotNetOAuth.Test/ServiceProviderDescriptionTests.cs index 99543c1..28b1593 100644 --- a/src/DotNetOAuth.Test/ServiceProviderDescriptionTests.cs +++ b/src/DotNetOAuth.Test/ServiceProviderDescriptionTests.cs @@ -20,7 +20,7 @@ namespace DotNetOAuth.Test { [TestMethod]
public void UserAuthorizationUriTest() {
ServiceProviderDescription target = new ServiceProviderDescription();
- MessageReceivingEndpoint expected = new MessageReceivingEndpoint("http://localhost/authorization", HttpDeliveryMethod.GetRequest);
+ MessageReceivingEndpoint expected = new MessageReceivingEndpoint("http://localhost/authorization", HttpDeliveryMethods.GetRequest);
MessageReceivingEndpoint actual;
target.UserAuthorizationEndpoint = expected;
actual = target.UserAuthorizationEndpoint;
@@ -36,7 +36,7 @@ namespace DotNetOAuth.Test { [TestMethod]
public void RequestTokenUriTest() {
var target = new ServiceProviderDescription();
- MessageReceivingEndpoint expected = new MessageReceivingEndpoint("http://localhost/requesttoken", HttpDeliveryMethod.GetRequest);
+ MessageReceivingEndpoint expected = new MessageReceivingEndpoint("http://localhost/requesttoken", HttpDeliveryMethods.GetRequest);
MessageReceivingEndpoint actual;
target.RequestTokenEndpoint = expected;
actual = target.RequestTokenEndpoint;
@@ -53,7 +53,7 @@ namespace DotNetOAuth.Test { [TestMethod, ExpectedException(typeof(ArgumentException))]
public void RequestTokenUriWithOAuthParametersTest() {
var target = new ServiceProviderDescription();
- target.RequestTokenEndpoint = new MessageReceivingEndpoint("http://localhost/requesttoken?oauth_token=something", HttpDeliveryMethod.GetRequest);
+ target.RequestTokenEndpoint = new MessageReceivingEndpoint("http://localhost/requesttoken?oauth_token=something", HttpDeliveryMethods.GetRequest);
}
/// <summary>
@@ -62,7 +62,7 @@ namespace DotNetOAuth.Test { [TestMethod]
public void AccessTokenUriTest() {
var target = new ServiceProviderDescription();
- MessageReceivingEndpoint expected = new MessageReceivingEndpoint("http://localhost/accesstoken", HttpDeliveryMethod.GetRequest);
+ MessageReceivingEndpoint expected = new MessageReceivingEndpoint("http://localhost/accesstoken", HttpDeliveryMethods.GetRequest);
MessageReceivingEndpoint actual;
target.AccessTokenEndpoint = expected;
actual = target.AccessTokenEndpoint;
|