Blog.Logic.Core.Tests.HobbyLogicTest.ShouldThrowExceptionWhenDeleteHobbyFails C# (CSharp) Method

ShouldThrowExceptionWhenDeleteHobbyFails() private method

private ShouldThrowExceptionWhenDeleteHobbyFails ( ) : void
return void
        public void ShouldThrowExceptionWhenDeleteHobbyFails()
        {
            _hobbyRepository = new Mock<IHobbyRepository>();
            _hobbyRepository.Setup(a => a.Delete(It.IsAny<Hobby>())).Throws(new Exception());

            _hobbyLogic = new HobbyLogic(_hobbyRepository.Object);

            Assert.Throws<BlogException>(() => _hobbyLogic.Delete(1));
        }
    }