【发布时间】:2011-08-01 14:30:26
【问题描述】:
我有那个控制器:
[Authorize(Roles = "Administrator")]
public class ApuradorController : Controller
{
private readonly Questiona2011Context _context;
private readonly AuthenticationService _authenticationService;
public ApuradorController(Questiona2011Context context, AuthenticationService authenticationService)
{
this._context = context;
this._authenticationService = authenticationService;
}
...
}
我正在使用 RoleProvider。如何在 Controller 中测试角色和授权?
【问题讨论】:
标签: .net asp.net-mvc unit-testing asp.net-mvc-3 asp.net-membership