-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionTargetTest.cs
36 lines (30 loc) · 1.17 KB
/
ActionTargetTest.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
namespace Manos.Routing.Tests
{
[TestFixture]
public class ActionTargetTest
{
[Test]
public void Ctor_NullArgument_Throws ()
{
Should.Throw<ArgumentNullException> (() => new ActionTarget (null));
}
[Test]
public void Ctor_ValidActon_SetsAction ()
{
var mat = new ActionTarget (ValidAction);
Assert.AreEqual (new ManosAction (ValidAction), mat.Action);
}
[Test]
public void ActionSetter_NullAction_Throws ()
{
var mat = new ActionTarget (ValidAction);
Should.Throw<ArgumentNullException> (() => mat.Action = null);
}
[Test]
public void ActionSetter_InvalidDelegateType_Throws ()
{
var mat = new ActionTarget (new ManosAction (ValidAction));
Should.Throw<InvalidOperationException> (() => mat.Action = new InvalidDelegate (InvalidAction));
}
}
}