//api/v1/filters public async Task <HttpResponseMessage> GetRecentFilters(int max = 10) { return(await GetServiceResponseAsync <IEnumerable <Filter> >(async() => { return await _filterLogic.GetRecentFiltersAsync(max); })); }
public async void GetRecentFiltersTests() { var filters = fixture.CreateMany <DeviceListFilter>(5); foreach (var filter in filters) { filter.Clauses = null; } _deviceListFilterRepositoryMock.Setup(x => x.GetRecentFiltersAsync(It.IsAny <int>(), It.IsAny <bool>())).ReturnsAsync(filters.Take(3)); var ret = await _filterLogic.GetRecentFiltersAsync(3); Assert.Equal(3, ret.Count()); }