public void GivenUserIsProvider_WhenGrantAccess_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(new List<Student>()); EducationSecurityPrincipal user = CreateProviderUser(new List<Provider>()); target.ExpectException<EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserHasNoRoles_WhenGrantAccess_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(Enumerable.Empty<Student>()); EducationSecurityPrincipal user = CreateUserWithNoRoles(); target.ExpectException<EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserRoleIsUnknown_WhenGrantAccess_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(new List <Student>()); EducationSecurityPrincipal user = CreateUserWithUnknownRole(); target.ExpectException <EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserIsProvider_WhenGrantAccess_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(new List <Student>()); EducationSecurityPrincipal user = CreateProviderUser(new List <Provider>()); target.ExpectException <EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserHasNoRoles_WhenGrantAccess_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(Enumerable.Empty <Student>()); EducationSecurityPrincipal user = CreateUserWithNoRoles(); target.ExpectException <EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserIsSiteCoordinator_AndDoesntHaveAccessToAll_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(new List<Student> { new Student { School = new School { UserRoles = new List<UserRole>() }, ApprovedProviders = new List<Provider>() } }); EducationSecurityPrincipal user = CreateSiteCoordinatorUser(new List<School>()); target.ExpectException<EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserIsSiteCoordinator_AndDoesntHaveAccessToAll_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(new List <Student> { new Student { School = new School { UserRoles = new List <UserRole>() }, ApprovedProviders = new List <Provider>() } }); EducationSecurityPrincipal user = CreateSiteCoordinatorUser(new List <School>()); target.ExpectException <EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }
public void GivenUserRoleIsUnknown_WhenGrantAccess_ThenThrowException() { CreateServiceRequestPermission target = new CreateServiceRequestPermission(new List<Student>()); EducationSecurityPrincipal user = CreateUserWithUnknownRole(); target.ExpectException<EntityAccessUnauthorizedException>(() => target.GrantAccess(user)); }