public GetAatfInfoByOrganisationRequestHandlerTests() { mapper = A.Fake <IMap <Aatf, AatfData> >(); dataAccess = A.Fake <IGenericDataAccess>(); authorization = A.Fake <IWeeeAuthorization>(); handler = new GetAatfInfoByOrganisationRequestHandler(mapper, dataAccess, authorization); }
public async void HandleAsync_NoOrganisationOrInternalAccess_ThrowsSecurityException() { var authorization = new AuthorizationBuilder().DenyInternalOrOrganisationAccess().Build(); handler = new GetAatfInfoByOrganisationRequestHandler(A.Fake <IMap <Aatf, AatfData> >(), A.Fake <IGenericDataAccess>(), authorization); Func <Task> action = async() => await handler.HandleAsync(A.Dummy <GetAatfByOrganisation>()); await action.Should().ThrowAsync <SecurityException>(); }