public async Task HandleAsync_NotInternalUser_ThrowsSecurityException()
        {
            const int complianceYear = 2016;

            var authorization = new AuthorizationBuilder().DenyInternalAreaAccess().Build();

            var handler = new GetUkNonObligatedWeeeReceivedDataCsvHandler(authorization, context, csvWriterFactory);
            var request = new GetUkNonObligatedWeeeReceivedDataCsv(complianceYear);

            Func <Task> action = async() => await handler.HandleAsync(request);

            await Assert.ThrowsAsync <SecurityException>(action);
        }
        public GetUkNonObligatedWeeeReceivedDataCsvHandlerTests()
        {
            context          = A.Fake <WeeeContext>();
            csvWriterFactory = A.Fake <CsvWriterFactory>();
            storedProcedures = A.Fake <IStoredProcedures>();
            fixture          = new Fixture();

            A.CallTo(() => context.StoredProcedures).Returns(storedProcedures);

            handler = new GetUkNonObligatedWeeeReceivedDataCsvHandler(
                new AuthorizationBuilder().AllowInternalAreaAccess().Build(),
                context,
                csvWriterFactory);
        }