Permalink
Browse files

- Exposed ActionResultType on ControllerActionInfo.

  • Loading branch information...
1 parent 7450dba commit 07f0df5410df5ad255b496e3e28b46da1e0da277 Kristoffer Ahl committed Oct 25, 2012
@@ -663,14 +663,15 @@ public void Should_not_have_any_policycontainers()
}
[Test]
- public void Should_expose_Action_and_ControllerType()
+ public void Should_expose_Controller_Action_and_ActionResult()
{
// Act & Assert
Because(configurationExpression =>
configurationExpression.ForActionsMatching(x =>
{
- Assert.That(x.Action, Is.Not.Empty);
Assert.That(x.Controller, Is.Not.Null);
+ Assert.That(x.Action, Is.Not.Empty);
+ Assert.True(typeof(ActionResult).IsAssignableFrom(x.ActionResult));
return false;
}));
@@ -7,11 +7,13 @@ public class ControllerActionInfo
{
public Type Controller { get; private set; }
public string Action { get; private set; }
+ public Type ActionResult { get; private set; }
internal ControllerActionInfo(Type controller, MethodInfo action)
{
Controller = controller;
Action = action.GetActionName();
+ ActionResult = action.ReturnType;
}
}
}

0 comments on commit 07f0df5

Please sign in to comment.