Ejemplo n.º 1
0
        public void GetAll_WhenCalled_ReturnsTwoNews()
        {
            //Act
            var news = _sut.GetAllNews(_url);

            //Assert
            Assert.Equal(2, news.Count());
        }
Ejemplo n.º 2
0
        public IActionResult Get()
        {
            try
            {
                var news = _feedService.GetAllNews(_url);
                if (news == null || !news.Any())
                {
                    return(NotFound("No news were found from this RSS feeds"));
                }

                return(Ok(news));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(NotFound("No news were found from this RSS feeds"));
            }
        }