public void AddNewStoryIdsToCache_Ids_ReturnsSameIdList()
        {
            var newStoryIds = new int[]{ 1, 2, 3 };

            var result = _storyCacheService.AddNewStoryIdsToCache(newStoryIds);
            Assert.That(newStoryIds, Is.EqualTo(result));
        }
Beispiel #2
0
        public async Task <IEnumerable <int> > GetNewStoryIds()
        {
            var newStories = _cache.GetNewStoryIdsCache();

            if (newStories != null)
            {
                return(newStories);
            }

            try
            {
                newStories = await _storyService.GetNewStories().ConfigureAwait(false);

                return(_cache.AddNewStoryIdsToCache(newStories));
            }
            catch
            {
                return(null);
            }
        }