public void TestCreateBlog() { var operations = new BlogOperations(new MockRepo()); var blogEntry = new BlogEntry(); operations.CreateBlogEntry(blogEntry); Assert.AreEqual(6, operations.GetAllBlogEntries().Count); }
// GET: Blog public ActionResult Index() { var blogOp = new BlogOperations(); var fullblogs = blogOp.GetAllBlogEntries().Where(m => m.EndDate > DateTime.Now || m.EndDate.HasValue == false).ToList(); //fullblogs.Count return View(fullblogs); }
public ActionResult Blogs() { var operations = new BlogOperations(); return View(operations.GetAllBlogEntries()); }
public void TestGetAllBlog() { var operations = new BlogOperations(new MockRepo()); Assert.AreEqual(5, operations.GetAllBlogEntries().Count); }
public void TestDeleteBlog() { var operations = new BlogOperations(new MockRepo()); operations.DeleteBlogEntry(2); Assert.AreEqual(4, operations.GetAllBlogEntries().Count); }
public List<BlogEntry> Get() { var blogOp = new BlogOperations(); return blogOp.GetAllBlogEntries(); }
// GET: Blog public ActionResult Index() { var blogOp = new BlogOperations(); var fullblogs = blogOp.GetAllBlogEntries().Where(m => m.EndDate > DateTime.Now || m.EndDate.HasValue == false).ToList(); //foreach (var blog in fullblogs) //{ // IdentityDbContext context = new IdentityDbContext(); // IdentityUser user = new IdentityUser(); // user = context.Users.Find(blog.UserID); // blog.UserName = user.UserName; //} //fullblogs.Count return View(fullblogs); }