public void AddLogo_EmptyLogo_ErrorResult() { LogoViewModel logo = new LogoViewModel() { Logo = null }; var result = manager.AddLogo(logo); TestContext.WriteLine(result.Details); Assert.That(result.Success, Is.False); }
public IActionResult AddLogo(LogoViewModel logo) { if (ModelState.IsValid) { var result = operatorManager.AddLogo(logo); if (!result.Success) { TempData["ErrorMessage"] = result.Details; return(RedirectToAction("Operators", "Operator")); } else { return(RedirectToAction("Operators", "Operator")); } } TempData["ErrorMessage"] = "Internal error"; return(RedirectToAction("Operators", "Operator")); }