Blog.Logic.Core.Tests.ViewCountLogicTest.ShouldThrowExceptionWhenGetViewCountFails C# (CSharp) Метод

ShouldThrowExceptionWhenGetViewCountFails() приватный Метод

private ShouldThrowExceptionWhenGetViewCountFails ( ) : void
Результат 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));
        }