Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
- Exposed ActionResultType on ControllerActionInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristoffer Ahl committed Oct 25, 2012
1 parent 7450dba commit 07f0df5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions FluentSecurity.Specification/ConfigurationExpressionSpec.cs
Expand Up @@ -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;
}));

Expand Down
2 changes: 2 additions & 0 deletions FluentSecurity/Internals/ControllerActionInfo.cs
Expand Up @@ -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.