public async void AddRequestsReturnsUnauthorised_WhenUserIsNotAnOrgAdmin() { var mediator = new Mock <IMediator>(); var validator = new Mock <IUnlinkedRequestViewModelValidator>(); var model = new Mock <UnlinkedRequestViewModel>(); var sut = new UnlinkedRequestController(mediator.Object, validator.Object); sut.MakeUserNotAnOrgAdmin(); Assert.IsType <UnauthorizedResult>(await sut.AddRequests(model.Object)); }
public async void ListReturnsRequestUnathorized_WhenUserIsNotAnOrgAdmin() { var mediator = new Mock <IMediator>(); var sut = new UnlinkedRequestController(mediator.Object); sut.MakeUserNotAnOrgAdmin(); await sut.List(); Assert.IsType <UnauthorizedResult>(await sut.List()); }