Blog.Logic.Core.Tests.ViewCountLogicTest.ShouldThrowExceptionWhenGetViewCountFails C# (CSharp) Méthode

ShouldThrowExceptionWhenGetViewCountFails() private méthode

private ShouldThrowExceptionWhenGetViewCountFails ( ) : void
Résultat 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));
        }