Example #1
0
        public RemoveAatfSiteHandlerTests()
        {
            this.context           = A.Fake <WeeeContext>();
            this.authorization     = A.Fake <IWeeeAuthorization>();
            this.genericDataAccess = A.Fake <IGenericDataAccess>();

            handler = new RemoveAatfSiteHandler(context, authorization, genericDataAccess);
        }
Example #2
0
        public async Task HandleAsync_NoExternalAccess_ThrowsSecurityException()
        {
            var authorization = new AuthorizationBuilder().DenyExternalAreaAccess().Build();

            var handler = new RemoveAatfSiteHandler(context, authorization, genericDataAccess);

            Func <Task> action = async() => await handler.HandleAsync(A.Dummy <RemoveAatfSite>());

            await action.Should().ThrowAsync <SecurityException>();
        }