public void GetRoles() { //given var me = SeedData.CreateAdminUser(Context); ISecurityProvider provider = new SecurityProvider(Context, me); var role1 = SeedData.CreateRole(Context, "Director"); var role2 = SeedData.CreateRole(Context, "Mentor"); var role3 = SeedData.CreateRole(Context, "Secretary"); //when var roles = provider.GetRoles(); //then roles.Count().ShouldEqual(4); }
public ActionResult GetRoles() { var roles = securityProvider.GetRoles().Select(role => new { role.Id, role.Name }); return(Json(roles, JsonRequestBehavior.AllowGet)); }