Exemple #1
0
        public void TestMockAverageRating()
        {
            var mock = new Mock <CommentRepository>();

            mock.Setup(a => a.GetComments(C.ProductId)).Returns(new List <Comment>()
            {
                C, CC
            });
            Assert.AreEqual((C.Rating + CC.Rating) / 2.0, CommentRepository.AverageRating(mock.Object, C.ProductId), "Average should be equal");
        }