diff options
Diffstat (limited to 'src/DotNetOAuth.Test')
-rw-r--r-- | src/DotNetOAuth.Test/Messaging/ChannelTests.cs | 9 | ||||
-rw-r--r-- | src/DotNetOAuth.Test/Mocks/TestBadChannel.cs | 8 | ||||
-rw-r--r-- | src/DotNetOAuth.Test/Mocks/TestChannel.cs | 12 | ||||
-rw-r--r-- | src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs | 8 |
4 files changed, 11 insertions, 26 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs index 6750739..26155cb 100644 --- a/src/DotNetOAuth.Test/Messaging/ChannelTests.cs +++ b/src/DotNetOAuth.Test/Messaging/ChannelTests.cs @@ -53,14 +53,9 @@ namespace DotNetOAuth.Test.Messaging { this.channel.Send(null);
}
- [TestMethod, ExpectedException(typeof(ArgumentNullException))]
- public void SendNull2() {
- this.channel.Send(null, new TestDirectedMessage());
- }
-
[TestMethod]
public void SendIndirectMessage301Get() {
- IProtocolMessage message = new TestDirectedMessage {
+ IProtocolMessage message = new TestDirectedMessage(MessageTransport.Indirect) {
Age = 15,
Name = "Andrew",
Location = new Uri("http://host/path"),
@@ -80,7 +75,7 @@ namespace DotNetOAuth.Test.Messaging { // We craft a very large message to force fallback to form POST.
// We'll also stick some HTML reserved characters in the string value
// to test proper character escaping.
- var message = new TestDirectedMessage {
+ var message = new TestDirectedMessage(MessageTransport.Indirect) {
Age = 15,
Name = "c<b" + new string('a', 10 * 1024),
Location = new Uri("http://host/path"),
diff --git a/src/DotNetOAuth.Test/Mocks/TestBadChannel.cs b/src/DotNetOAuth.Test/Mocks/TestBadChannel.cs index 20fe03a..4c06980 100644 --- a/src/DotNetOAuth.Test/Mocks/TestBadChannel.cs +++ b/src/DotNetOAuth.Test/Mocks/TestBadChannel.cs @@ -30,13 +30,5 @@ namespace DotNetOAuth.Test.Mocks { protected override void SendDirectMessageResponse(IProtocolMessage response) {
throw new NotImplementedException();
}
-
- protected override void ReportErrorToUser(ProtocolException exception) {
- throw new NotImplementedException();
- }
-
- protected override void ReportErrorAsDirectResponse(ProtocolException exception) {
- throw new NotImplementedException();
- }
}
}
diff --git a/src/DotNetOAuth.Test/Mocks/TestChannel.cs b/src/DotNetOAuth.Test/Mocks/TestChannel.cs index 632257e..359019f 100644 --- a/src/DotNetOAuth.Test/Mocks/TestChannel.cs +++ b/src/DotNetOAuth.Test/Mocks/TestChannel.cs @@ -17,23 +17,15 @@ namespace DotNetOAuth.Test.Mocks { }
protected internal override IProtocolMessage Request(IDirectedProtocolMessage request) {
- throw new NotImplementedException();
+ throw new NotImplementedException("Request");
}
protected internal override IProtocolMessage ReadFromResponse(System.IO.Stream responseStream) {
- throw new NotImplementedException();
+ throw new NotImplementedException("ReadFromResponse");
}
protected override void SendDirectMessageResponse(IProtocolMessage response) {
throw new NotImplementedException("SendDirectMessageResponse");
}
-
- protected override void ReportErrorToUser(ProtocolException exception) {
- throw new NotImplementedException();
- }
-
- protected override void ReportErrorAsDirectResponse(ProtocolException exception) {
- throw new NotImplementedException();
- }
}
}
diff --git a/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs b/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs index 6972624..0e600b5 100644 --- a/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs @@ -11,6 +11,12 @@ namespace DotNetOAuth.Test.Mocks { [DataContract(Namespace = Protocol.DataContractNamespaceV10)]
internal class TestDirectedMessage : IDirectedProtocolMessage {
+ private MessageTransport transport;
+
+ internal TestDirectedMessage(MessageTransport transport) {
+ this.transport = transport;
+ }
+
[DataMember(Name = "age", IsRequired = true)]
public int Age { get; set; }
[DataMember]
@@ -33,7 +39,7 @@ namespace DotNetOAuth.Test.Mocks { }
MessageTransport IProtocolMessage.Transport {
- get { return MessageTransport.Direct; }
+ get { return this.transport; }
}
void IProtocolMessage.EnsureValidMessage() {
|