コード例 #1
0
        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>();
        }
コード例 #2
0
        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);
        }