-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAsyncControllerTests.cs
More file actions
46 lines (40 loc) · 1.28 KB
/
AsyncControllerTests.cs
File metadata and controls
46 lines (40 loc) · 1.28 KB
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
46
using NUnit.Framework;
using TestStack.FluentMVCTesting.Tests.TestControllers;
namespace TestStack.FluentMVCTesting.Tests
{
class AsyncControllersShould
{
private AsyncController _controller;
[SetUp]
public void Setup()
{
_controller = new AsyncController();
}
[Test]
public void Work_correctly_for_valid_check()
{
_controller.WithCallTo(c => c.AsyncViewAction())
.ShouldRenderDefaultView();
}
[Test]
public void Work_correctly_for_invalid_check()
{
Assert.Throws<ActionResultAssertionException>(
() => _controller.WithCallTo(c => c.AsyncViewAction()).ShouldGiveHttpStatus()
);
}
[Test]
public void Work_correctly_for_valid_child_action_check()
{
_controller.WithCallToChild(c => c.AsyncChildViewAction())
.ShouldRenderDefaultView();
}
[Test]
public void Work_correctly_for_invalid_child_action_check()
{
Assert.Throws<InvalidControllerActionException>(
() => _controller.WithCallToChild(c => c.AsyncViewAction())
);
}
}
}