blob: 430b929ccecacc548d3950d8aeda3a0b9aae1fff (
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="Andrew Arnott">
// Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Test.Messaging {
using System;
using DotNetOpenAuth.Messaging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class ProtocolExceptionTests : TestBase {
[TestMethod]
public void CtorDefault() {
ProtocolException ex = new ProtocolException();
}
[TestMethod]
public void CtorWithTextMessage() {
ProtocolException ex = new ProtocolException("message");
Assert.AreEqual("message", ex.Message);
}
[TestMethod]
public void CtorWithTextMessageAndInnerException() {
Exception innerException = new Exception();
ProtocolException ex = new ProtocolException("message", innerException);
Assert.AreEqual("message", ex.Message);
Assert.AreSame(innerException, ex.InnerException);
}
[TestMethod]
public void CtorWithProtocolMessage() {
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", (IProtocolMessage)null);
}
}
}
|