blob: c51968065f04cf6eb1f9f53f22f62490065873a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
//-----------------------------------------------------------------------
// <copyright file="ProtocolExceptionTests.cs" company="Outercurve Foundation">
// Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Test.Messaging {
using System;
using DotNetOpenAuth.Messaging;
using NUnit.Framework;
[TestFixture]
public class ProtocolExceptionTests : TestBase {
[Test]
public void CtorDefault() {
ProtocolException ex = new ProtocolException();
}
[Test]
public void CtorWithTextMessage() {
ProtocolException ex = new ProtocolException("message");
Assert.AreEqual("message", ex.Message);
}
[Test]
public void CtorWithTextMessageAndInnerException() {
Exception innerException = new Exception();
ProtocolException ex = new ProtocolException("message", innerException);
Assert.AreEqual("message", ex.Message);
Assert.AreSame(innerException, ex.InnerException);
}
[Test]
public void CtorWithProtocolMessage() {
IProtocolMessage message = new Mocks.TestDirectedMessage();
ProtocolException ex = new ProtocolException("message", message);
Assert.AreSame(message, ex.FaultedMessage);
}
[Test]
public void CtorWithNullProtocolMessage() {
new ProtocolException("message", (IProtocolMessage)null);
}
}
}
|