public void EditPost_Always_CreatesNewTagsWhenNotInTagListPassedToTheResolver()
        {
            // Arrange
            var vm = new PostViewModel { Tags = "z" };
            using (var controller = new HomeController())
            {
                // Act
                var result = controller.EditPost(vm) as ViewResult;

                // Assert
                var post = result.Model as Post;
                Assert.AreEqual(1, post.Tags.Count());
                Assert.AreEqual(0, post.Tags[0].Id);
                Assert.AreEqual("z", post.Tags[0].Name);
            }
        }
        public void EditPost_Always_UsesTagListPassedToTheResolver()
        {
            // Arrange
            var vm = new PostViewModel { Tags = "a,c,d" };
            using (var controller = new HomeController())
            {
                // Act
                var result = controller.EditPost(vm) as ViewResult;

                // Assert
                var post = result.Model as Post;
                Assert.AreEqual(3, post.Tags.Count());
                Assert.AreEqual(1, post.Tags[0].Id);
                Assert.AreEqual(3, post.Tags[1].Id);
                Assert.AreEqual(4, post.Tags[2].Id);
            }
        }