Пример #1
0
 //api/v1/filters
 public async Task <HttpResponseMessage> GetRecentFilters(int max = 10)
 {
     return(await GetServiceResponseAsync <IEnumerable <Filter> >(async() =>
     {
         return await _filterLogic.GetRecentFiltersAsync(max);
     }));
 }
Пример #2
0
        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());
        }