diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-02-08 20:09:38 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-02-08 20:09:38 -0800 |
commit | 79e4a9572cca67fb18f34d2d3dbbbe2c9a2fc933 (patch) | |
tree | 8497f3c89dec82043dc1fecd966ef4eea51bedf3 /src/DotNetOpenAuth.Test | |
parent | 26b2ba62a11e28652f999d4b6f3d00e986c4ba6d (diff) | |
download | DotNetOpenAuth-79e4a9572cca67fb18f34d2d3dbbbe2c9a2fc933.zip DotNetOpenAuth-79e4a9572cca67fb18f34d2d3dbbbe2c9a2fc933.tar.gz DotNetOpenAuth-79e4a9572cca67fb18f34d2d3dbbbe2c9a2fc933.tar.bz2 |
Removed ProtocolException message-like behavior which was never used and doesn't fit into the design any more.
Diffstat (limited to 'src/DotNetOpenAuth.Test')
-rw-r--r-- | src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs | 60 |
1 files changed, 4 insertions, 56 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs b/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs index 21f2928..430b929 100644 --- a/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs @@ -32,66 +32,14 @@ namespace DotNetOpenAuth.Test.Messaging { [TestMethod] public void CtorWithProtocolMessage() { - IProtocolMessage request = new Mocks.TestDirectedMessage(); - Uri receiver = new Uri("http://receiver"); - ProtocolException ex = new ProtocolException("some error occurred", request, receiver); - IDirectedProtocolMessage msg = (IDirectedProtocolMessage)ex; - Assert.AreEqual("some error occurred", ex.Message); - Assert.AreSame(receiver, msg.Recipient); - Assert.AreEqual(request.Version, msg.Version); - Assert.AreEqual(request.Transport, msg.Transport); - msg.EnsureValidMessage(); + IProtocolMessage message = new Mocks.TestDirectedMessage(); + ProtocolException ex = new ProtocolException("message", message); + Assert.AreSame(message, ex.FaultedMessage); } [TestMethod, ExpectedException(typeof(ArgumentNullException))] public void CtorWithNullProtocolMessage() { - new ProtocolException("message", null, new Uri("http://receiver")); - } - - [TestMethod, ExpectedException(typeof(ArgumentNullException))] - public void CtorWithNullReceiver() { - new ProtocolException("message", new Mocks.TestDirectedMessage(MessageTransport.Indirect), null); - } - - /// <summary> - /// Tests that exceptions being sent as direct responses do not need an explicit receiver. - /// </summary> - [TestMethod] - public void CtorUndirectedMessageWithNullReceiver() { - IProtocolMessage request = new Mocks.TestDirectedMessage(MessageTransport.Direct); - ProtocolException ex = new ProtocolException("message", request, null); - IDirectedProtocolMessage msg = (IDirectedProtocolMessage)ex; - Assert.IsNull(msg.Recipient); - Assert.AreEqual(request.Version, msg.Version); - Assert.AreEqual(request.Transport, msg.Transport); - } - - [TestMethod, ExpectedException(typeof(InvalidOperationException))] - public void ProtocolVersionWithoutMessage() { - ProtocolException ex = new ProtocolException(); - IDirectedProtocolMessage msg = (IDirectedProtocolMessage)ex; - var temp = msg.Version; - } - - [TestMethod, ExpectedException(typeof(InvalidOperationException))] - public void TransportWithoutMessage() { - ProtocolException ex = new ProtocolException(); - IDirectedProtocolMessage msg = (IDirectedProtocolMessage)ex; - var temp = msg.Transport; - } - - [TestMethod, ExpectedException(typeof(InvalidOperationException))] - public void RecipientWithoutMessage() { - ProtocolException ex = new ProtocolException(); - IDirectedProtocolMessage msg = (IDirectedProtocolMessage)ex; - var temp = msg.Recipient; - } - - [TestMethod, ExpectedException(typeof(InvalidOperationException))] - public void EnsureValidMessageWithoutMessage() { - ProtocolException ex = new ProtocolException(); - IDirectedProtocolMessage msg = (IDirectedProtocolMessage)ex; - msg.EnsureValidMessage(); + new ProtocolException("message", (IProtocolMessage)null); } } } |