Example #1
0
        public GetAatfSubmissionHistoryHandlerTests()
        {
            authorization = A.Fake <IWeeeAuthorization>();
            dataAccess    = A.Fake <IGetAatfSubmissionHistoryDataAccess>();
            mapper        = A.Fake <IMapper>();
            fixture       = new Fixture();

            handler = new GetAatfSubmissionHistoryHandler(dataAccess, authorization, mapper);
        }
Example #2
0
        public async Task HandleAsync_WhenUserCannotAccessInternalArea_ThrowsSecurityException()
        {
            var authorization = new AuthorizationBuilder().DenyInternalAreaAccess().Build();

            var handler = new GetAatfSubmissionHistoryHandler(dataAccess, authorization, mapper);

            Func <Task> data = async() => await handler.HandleAsync(A.Dummy <GetAatfSubmissionHistory>());

            await Assert.ThrowsAsync <SecurityException>(data);
        }