Example #1
0
        public async Task Test_Apply_Loan()
        {
            //Arrange
            var fakeLoan = LoanFakes.GetFakeLoan();

            //Act
            await _customerLoanController.Apply(fakeLoan);

            var loans = await _customerLoanController.Index();

            var loansValue = (loans.Result as OkObjectResult).Value as IEnumerable <Loan>;

            //Assert
            loansValue.Should().NotBeNull();
            loansValue.Count().Should().Be(1);
            loansValue.ToArray()[0].CustomerID.Should().Be(2);
        }