Blog.Logic.Core.Tests.AddressLogicTest.ShouldThrowExceptionWhenAddAddressFails C# (CSharp) Méthode

ShouldThrowExceptionWhenAddAddressFails() private méthode

private ShouldThrowExceptionWhenAddAddressFails ( ) : void
Résultat void
        public void ShouldThrowExceptionWhenAddAddressFails()
        {
            _addressRepository = new Mock<IAddressRepository>();
            _addressRepository.Setup(a => a.Add(It.IsAny<Address>())).Throws(new Exception());

            _addressLogic = new AddressLogic(_addressRepository.Object);

            Assert.Throws<BlogException>(() => _addressLogic.Add(new Common.Contracts.Address()));
        }