Exemple #1
0
        public async Task GetAllAsync_ReturnsAActionResultWithAListOfArticles()
        {
            _articleServiceMock.Setup(services => services.GetAllAsync()).ReturnsAsync(GetFaceArticles());
            var controller = new ArticlesController(_articleServiceMock.Object);

            var result = await controller.GetAllAsync();

            var actionResult = Assert.IsType <ActionResult <List <Article> > >(result);
            var returnValue  = Assert.IsType <List <Article> >(actionResult.Value);

            Assert.Equal(GetFaceArticles().Count, returnValue.Count());
        }