public virtual ActionResult Create(HubOwner HubOwner) { if (ModelState.IsValid) { _hubOwnerService.AddHubOwner(HubOwner); return Json(new { success = true }); } return PartialView(HubOwner); }
public void CanDoEditPostBack() { //ACT var hubOwner = new HubOwner { LongName = "Belay Zeleke", Name = "Beze" }; var redirectToRouteResult = _hubOwnerController.Create(hubOwner) as RedirectToRouteResult; //Assert Assert.NotNull(redirectToRouteResult); Assert.AreEqual("Index", redirectToRouteResult.RouteValues["Action"]); Assert.AreEqual("HubOwner", redirectToRouteResult.RouteValues["controller"]); }