1
Answer

How to write nunit testing for this method in mvc

sangeetha k

sangeetha k

6y
1.1k
1
# The controller method 
 
 
public ActionResult TermsandConditionsDeclineValidation(string AccountName)
{
try
{
string strLoanNumber = repository.GetLoanNumber(Session["access_token"].ToString());
int LoanID = repository.GetLoanId(TUtil.CheckString(strLoanNumber, string.Empty), Session["AccountName"].ToString());
int? IsTcAccepted = repository.TermsandConditionsDeclineValidation(TUtil.CheckInt(LoanID, 0));
if (IsTcAccepted == 0 || IsTcAccepted == null)
{
return RedirectToAction("EndSessionPage");
}
else
{
return RedirectToAction("GetClients");
}
}
catch (Exception ex)
{
Log.WriteError(TUtil.GetMethodExceptionContext(AccountName), ex);
return View();
}
}
Answers (1)