public void CanCreateAndDeleteLink() { UnitTestHelper.SetupBlog(); var repository = new DatabaseObjectProvider(); int categoryId = repository.CreateLinkCategory(CreateCategory("My Favorite Feeds", "Some of my favorite RSS feeds", CategoryType.LinkCollection, true)); Link link = CreateLink(repository, "Title", categoryId, null); int linkId = link.Id; Link loaded = repository.GetLink(linkId); Assert.AreEqual("Title", loaded.Title); Assert.AreEqual(NullValue.NullInt32, loaded.PostId); Assert.AreEqual(Config.CurrentBlog.Id, loaded.BlogId); repository.DeleteLink(linkId); Assert.IsNull(repository.GetLink(linkId)); }