Beispiel #1
0
        public void TestIGetloan_ThrowsException()
        {
            _repository.Setup(rep => rep.Getloan()).Throws(new Exception());
            var processor = new  cba.LoadManagement.BusinessLogic.LoanManagement(_repository.Object);

            //Act
            var exception = Record.Exception(() => processor.Getloan());

            //Assert
            Assert.IsType <Exception>(exception);
            Assert.Equal("Exception of type 'System.Exception' was thrown.", exception.Message);
        }
Beispiel #2
0
        public void TestIGetloan()
        {
            //Arrange

            _repository.Setup(rep => rep.Getloan()).Returns(_loandetails);
            var processor = new cba.LoadManagement.BusinessLogic.LoanManagement(_repository.Object);

            //Act
            var output = processor.Getloan();

            Assert.NotNull(output);
            _repository.VerifyAll();
            //Assert
            Assert.NotEmpty(output);
        }