-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigSettingsProviderExceptionTest.cs
43 lines (35 loc) · 1.25 KB
/
ConfigSettingsProviderExceptionTest.cs
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
using System;
using ByteDev.Configuration.ConfigSection;
using NUnit.Framework;
namespace ByteDev.Configuration.UnitTests.ConfigSection
{
[TestFixture]
public class ConfigSettingsProviderExceptionTest
{
[TestFixture]
public class Constructor
{
private const string Message = "something went wrong";
[Test]
public void WhenCalledWithNoArgs_ThenReturnException()
{
var sut = new ConfigSettingsProviderException();
Assert.That(sut, Is.Not.Null);
}
[Test]
public void WhenCalledWithMessage_ThenSetMessage()
{
var sut = new ConfigSettingsProviderException(Message);
Assert.That(sut.Message, Is.EqualTo(Message));
}
[Test]
public void WhenCalledWithMessageAndInnerException_ThenSetMessageAndInnerException()
{
var innerException = new Exception();
var sut = new ConfigSettingsProviderException(Message, innerException);
Assert.That(sut.Message, Is.EqualTo(Message));
Assert.That(sut.InnerException, Is.SameAs(innerException));
}
}
}
}