sangeetha k

sangeetha k

  • NA
  • 207
  • 51.3k

How to write nunit testing for this method in mvc

Jul 3 2018 8:05 AM
# 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)