protected void TheName(string fullName) { model = new NewAccountModel { FirstName = fullName.Split(' ')[0], LastName = fullName.Split(' ')[1] }; session = Substitute.For<IDocumentService>(); cookieGenerator = Substitute.For<IAuthCookieGenerator>(); controller = new RegistrationController(session, cookieGenerator); }
public ActionResult Register(NewAccountModel model) { if (!ModelState.IsValid) { return View("Index", model); } var account = new Account(); model.Update(account); _documentService.Save(account); _authCookieGenerator.SetAuthCookie(account.NameSlug); return RedirectToAction("Index", "Today", new {nameslug=account.NameSlug}); }