public GetReturnObligatedCsvHandlerTests() { this.authorization = A.Fake <IWeeeAuthorization>(); this.weeContext = A.Fake <WeeeContext>(); this.returnDataAccess = A.Fake <IReturnDataAccess>(); this.handler = new GetReturnObligatedCsvHandler(authorization, weeContext, returnDataAccess); }
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>(); }