Blog.Logic.Core.Tests.ViewCountLogicTest.ShouldGetViewCounts C# (CSharp) Method

ShouldGetViewCounts() private method

private ShouldGetViewCounts ( ) : void
return void
        public void ShouldGetViewCounts()
        {
            var viewCount = _viewCount.Where(a => a.PostId == 1).ToList();
            _viewCountRepository = new Mock<IViewCountRepository>();
            _viewCountRepository.Setup(a => a.Find(It.IsAny<Expression<Func<ViewCount, bool>>>(), true))
                .Returns(viewCount);

            _viewCountLogic = new ViewCountLogic(_viewCountRepository.Object);

            var result = _viewCountLogic.Get(1);

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(1, result[0].PostId);
            Assert.AreEqual(1, result[1].PostId);
        }