Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 // GET: Tags
 public ActionResult TagIndex()
 {
     var manager = new AdminManager();
     var tags = manager.GetAllTags();
     return View(tags);
 }