public void AddReturnsSuccessResult()
        {
            FakePostService postService = new FakePostService();

            Guid postId = Guid.NewGuid();

            postService.AddedPosts.Add(new Post()
            {
                ID = postId, Trackbacks = new List <Trackback>(new[] { new Trackback()
                                                                       {
                                                                           Url = "http://test"
                                                                       } })
            });

            FormCollection form = new FormCollection();

            form.Add("url", "http://test");
            form.Add("title", "Test");
            form.Add("blog_name", "Test Blog");
            form.Add("excerpt", "Test excerpt");

            TrackbackController controller = new TrackbackController(postService);

            TrackbackViewModel result = controller.Add(postId, form);

            Assert.Equal(0, result.ErrorCode);
            Assert.True(string.IsNullOrEmpty(result.ErrorMessage));
        }
        public void AddFaultsIfPostIsNotFound()
        {
            FakePostService postService = new FakePostService();

            TrackbackController controller = new TrackbackController(postService);

            TrackbackViewModel result = controller.Add(Guid.NewGuid(), null);

            Assert.NotNull(result);
            Assert.Equal(0, result.ErrorCode);
        }