Ejemplo n.º 1
0
        public void Add_to_Favorites_Functionality_Should_Work()
        {
            var news = new News
            {
                Title = ""
            };

            _mock.Setup(item => item.AddNews(news));
            var actual = (CreatedResult)_newsController.AddToFavorites(news);

            _mock.Verify(item => item.AddNews(news), Times.Once);
            Assert.IsAssignableFrom <IActionResult>(actual);
            Assert.Equal(201, actual.StatusCode);
        }