public async void Get_Loan_Wrong_Id() { using (var context = GetContextWithData()) using (var controller = new LoansController(context)) { var loanId = 99999; var result = await controller.GetLoan(loanId); Assert.IsType <NotFoundResult>(result); } }
public async void Get_Loan() { using (var context = GetContextWithData()) using (var controller = new LoansController(context)) { var loanId = context.Loans.FirstOrDefault().LoanID; var result = await controller.GetLoan(loanId); Assert.IsType <OkObjectResult>(result); } }