public async Task HandleAsync_GivenMessage_AatfSubmissionHistoryDataAccessShouldBeCalled() { var message = new GetAatfSubmissionHistory(Guid.NewGuid()); await handler.HandleAsync(message); A.CallTo(() => dataAccess.GetItemsAsync(message.AatfId)).MustHaveHappenedOnceExactly(); }
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); }