-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathPipelineExecutorTests.cs
More file actions
34 lines (28 loc) · 998 Bytes
/
PipelineExecutorTests.cs
File metadata and controls
34 lines (28 loc) · 998 Bytes
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
using System.Web.Mvc;
using NUnit.Framework;
using TestStack.FluentMVCTesting.MvcPipeline;
using TestStack.FluentMVCTesting.Tests.TestControllers;
namespace TestStack.FluentMVCTesting.Tests.MvcPipeline
{
[TestFixture]
class PipelineExecutorTests
{
[Test]
public void should_call_filters()
{
var controller = new ControllerExtensionsController();
GlobalFilters.Filters.Add(new DummyFilter());
var executor = new PipelineActionExecutor();
var result = executor.Execute(controller, c => c.SomeAction());
Assert.That(DummyFilter.LoggingFilterWasCalled);
}
private class DummyFilter : ActionFilterAttribute, IActionFilter
{
public static bool LoggingFilterWasCalled { get; set; }
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
LoggingFilterWasCalled = true;
}
}
}
}