public async Task HandleAsync_GivenGetAatfRequestWithoutFilter_DataAccessFetchIsCalled() { var request = new GetAatfs(fixture.Create <FacilityType>()); await handler.HandleAsync(request); A.CallTo(() => dataAccess.GetLatestAatfs()).MustHaveHappened(Repeated.Exactly.Once); }
public async Task <List <AatfDataList> > HandleAsync(GetAatfs message) { authorization.EnsureCanAccessInternalArea(); var aatfs = message.Filter == null ? await dataAccess.GetLatestAatfs() : await dataAccess.GetFilteredAatfs(message.Filter); if (message.FacilityType == FacilityType.Aatf) { return(SortAatfs(aatfs, FacilityType.Aatf)); } else { return(SortAatfs(aatfs, FacilityType.Ae)); } }