public async Task HandleAsync_NoExternalAccess_ThrowsSecurityException() { var authorization = new AuthorizationBuilder().DenyExternalAreaAccess().Build(); var handler = new AddAatfSiteHandler(weeeContext, authorization, addAatfSiteDataAccess, genericDataAccess, organisationDetailsDataAccess); Func <Task> action = async() => await handler.HandleAsync(A.Dummy <AddAatfSite>()); await action.Should().ThrowAsync <SecurityException>(); }
public AddAatfSiteHandlerTests() { authorisation = A.Fake <IWeeeAuthorization>(); addAatfSiteDataAccess = A.Fake <IAatfSiteDataAccess>(); genericDataAccess = A.Fake <IGenericDataAccess>(); obligatedReusedDataAccess = A.Fake <IObligatedReusedDataAccess>(); organisationDetailsDataAccess = A.Fake <IOrganisationDetailsDataAccess>(); weeeContext = A.Fake <WeeeContext>(); handler = new AddAatfSiteHandler(weeeContext, authorisation, addAatfSiteDataAccess, genericDataAccess, organisationDetailsDataAccess); }