sangeetha k

sangeetha k

  • 1.7k
  • 207
  • 27.8k

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();
}
}

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)