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

ShouldThrowExceptionWhenGetViewCountFails() private method

private ShouldThrowExceptionWhenGetViewCountFails ( ) : void
return void
        public void ShouldThrowExceptionWhenGetViewCountFails()
        {
            _viewCountRepository = new Mock<IViewCountRepository>();
            _viewCountRepository.Setup(a => a.Find(It.IsAny<Expression<Func<ViewCount, bool>>>(), true))
                .Throws(new Exception());

            _viewCountLogic = new ViewCountLogic(_viewCountRepository.Object);

            Assert.Throws<BlogException>(() => _viewCountLogic.Get(1));
        }