public void Login_AddsUserToSessionBlogTable_User() { Blog newBlog = new Blog("a", "b", 2); newBlog.Save(); Blog.Login("a", "b"); Assert.AreEqual(newBlog.GetId(), SessionBlog.GetId()); }
public ActionResult Index() { if (SessionBlog.GetId() == 0) { return(View()); } else { return(RedirectToAction("Show", "Blogs", new{ id = SessionBlog.GetId() })); } }