public void ConvertToAkismetItem_WithContactPageFeedback_DoesNotSetPermalink()
        {
            // arrange
            var feedback = new FeedbackItem(FeedbackType.ContactPage);
            var urlHelper = new Mock<BlogUrlHelper>();
            urlHelper.Setup(helper => helper.FeedbackUrl(It.IsAny<FeedbackItem>())).Returns((VirtualPath)null);
            urlHelper.Setup(helper => helper.BlogUrl()).Returns("/");
            var service = new AkismetSpamService("abracadabra", new Blog {Host = "localhost"}, null, urlHelper.Object);

            // act
            var comment = service.ConvertToAkismetItem(feedback);

            // assert
            Assert.IsNull(comment.Permalink);
        }
        public void ConvertToAkismetItem_WithFeedback_SetsProperties()
        {
            // arrange
            var feedback = new FeedbackItem(FeedbackType.ContactPage)
            {
                SourceUrl = new Uri("http://example.com/author-source")
            };
            var urlHelper = new Mock<BlogUrlHelper>();
            urlHelper.Setup(helper => helper.FeedbackUrl(It.IsAny<FeedbackItem>())).Returns("/foo");
            urlHelper.Setup(helper => helper.BlogUrl()).Returns("/");
            var service = new AkismetSpamService("abracadabra", new Blog { Host = "localhost" }, null, urlHelper.Object);

            // act
            var comment = service.ConvertToAkismetItem(feedback);

            // assert
            Assert.AreEqual("http://example.com/author-source", comment.AuthorUrl.ToString());
            Assert.AreEqual("http://localhost/foo", comment.Permalink.ToString());
        }