public void Update_EmptyOperator_ErrorResult() { OperatorViewModel test = new OperatorViewModel(); var result = manager.Update(test); TestContext.WriteLine(result.Details); Assert.That(result.Success, Is.False); }
public IActionResult Operator(OperatorViewModel editedOper, PageState pageState) { if (ModelState.IsValid) { var result = operatorManager.Update(editedOper); if (!result.Success) { TempData["ErrorMessage"] = result.Details; return(Redirect(Url.Action("Operators", pageState))); } else { return(Redirect(Url.Action("Operators", pageState))); } } TempData["ErrorMessage"] = "Internal error!"; return(RedirectToAction("Operators", "Operator")); }