public async Task CreateNewLoan() { var newLoan = new NewLoan { BorrowerName = "Test New Loan", FundingAmount = 500, RepaymentAmount = 600 }; var result = await _controller.Create(newLoan) as ObjectResult; var actualResult = (Loan)result.Value; _repo.Verify(x => x.AddNewLoan(It.IsAny <Loan>()), Times.Once); Assert.IsType <OkObjectResult>(result); Assert.Equal(newLoan.BorrowerName, actualResult.BorrowerName); }