public override string Execute()
 {
     try
     {
         Links.DeleteLink(_targetID);
         return(FormatMessage(ExecuteSuccessMessage, _targetName, itemTitle));
     }
     catch (Exception ex)
     {
         return(FormatMessage(ExecuteFailureMessage, _targetName, itemTitle, ex.Message));
     }
 }
Esempio n. 2
0
        public void CanCreateAndDeleteLink()
        {
            UnitTestHelper.SetupBlog();

            int categoryId =
                Links.CreateLinkCategory(CreateCategory("My Favorite Feeds", "Some of my favorite RSS feeds",
                                                        CategoryType.LinkCollection, true));

            Link link   = CreateLink("Title", categoryId, null);
            int  linkId = link.Id;

            Link loaded = ObjectProvider.Instance().GetLink(linkId);

            Assert.AreEqual("Title", loaded.Title);
            Assert.AreEqual(NullValue.NullInt32, loaded.PostId);
            Assert.AreEqual(Config.CurrentBlog.Id, loaded.BlogId);

            Links.DeleteLink(linkId);

            Assert.IsNull(ObjectProvider.Instance().GetLink(linkId));
        }