public void CanAddTag() { var manager = new AdminManager(); var toAdd = new Tag(); var tagCount = manager.GetAllTags().Count; toAdd.TagID = tagCount + 1; toAdd.TagName = "TestTag"; manager.AddTag(toAdd); var secondCount = manager.GetAllTags().Count; Assert.AreEqual(tagCount + 1, secondCount); }
public void CancEditTag() { var manager = new AdminManager(); var toEdit = manager.GetTagById(manager.GetAllTags().Count); toEdit.TagName = "EditedTag"; manager.EditTag(toEdit); var toCheck = manager.GetTagById(manager.GetAllTags().Count); Assert.AreEqual(toCheck.TagName,toEdit.TagName); }
public void CanDeleteTag() { var manager = new AdminManager(); var count = manager.GetAllTags().Count; manager.DeleteTag(count); var secondCount = manager.GetAllTags().Count; Assert.AreEqual(count -1 ,secondCount); }
// GET: Tags public ActionResult TagIndex() { var manager = new AdminManager(); var tags = manager.GetAllTags(); return View(tags); }