Example #1
0
        public void GetAllReviews()
        {
            // Arrange
            Mock.Get(_repositoryWrapper.Review).Setup(x => x.GetAllReviews()).ReturnsAsync(DataSeeder.Reviews);
            var controller = new ReviewController(_loggerManager, _mapper, _repositoryWrapper);
            // Act
            var actionResult = controller.GetAllReviews().Result;
            // Assert
            var okObjectResult = actionResult as OkObjectResult;

            Assert.IsNotNull(okObjectResult);
            var results = okObjectResult.Value as IEnumerable <Review>;

            Assert.IsTrue(results.Count() == DataSeeder.Reviews.Count());
        }