public async Task HandleAsync_GivenGetSentOnAatfSiteRequest_DataAccessIsCalled() { var aatfId = Guid.NewGuid(); var returnId = Guid.NewGuid(); await handler.HandleAsync(new GetWeeeSentOn(aatfId, returnId, null)); A.CallTo(() => getSentOnAatfSiteDataAccess.GetWeeeSentOnByReturnAndAatf(aatfId, returnId)).MustHaveHappened(Repeated.Exactly.Once); }
public async Task HandleAsync_NoExternalAccess_ThrowsSecurityException() { var authorization = new AuthorizationBuilder().DenyExternalAreaAccess().Build(); var handler = new GetWeeeSentOnHandler(authorization, getSentOnAatfSiteDataAccess, fetchWeeeSentOnAmountDataAccess, addressMapper); Func <Task> action = async() => await handler.HandleAsync(A.Dummy <GetWeeeSentOn>()); await action.Should().ThrowAsync <SecurityException>(); }