Exemplo n.º 1
0
        public GetReturnObligatedCsvHandlerTests()
        {
            this.authorization    = A.Fake <IWeeeAuthorization>();
            this.weeContext       = A.Fake <WeeeContext>();
            this.returnDataAccess = A.Fake <IReturnDataAccess>();

            this.handler = new GetReturnObligatedCsvHandler(authorization, weeContext, returnDataAccess);
        }
Exemplo n.º 2
0
        public async Task HandleAsync_GivenNoOrganisationAccess_SecurityExceptionExpected()
        {
            var handler = new GetReturnObligatedCsvHandler(new AuthorizationBuilder().DenyOrganisationAccess().Build(), weeContext, returnDataAccess);

            var returnId = SetupReturn();

            var result = await Xunit.Record.ExceptionAsync(() => handler.HandleAsync(new GetReturnObligatedCsv(returnId)));

            result.Should().BeOfType <SecurityException>();
        }