BloggingSystem.IntegrationTests.PostsControllerIntegrationTests.Create_WhenValidPostWithTags_ShouldReturn201CodeAndPostedPost C# (CSharp) Method

Create_WhenValidPostWithTags_ShouldReturn201CodeAndPostedPost() private method

        public void Create_WhenValidPostWithTags_ShouldReturn201CodeAndPostedPost()
        {
            PostModel newPost = new PostModel()
            {
                Title = "Peshov post",
                Text = "Pesho posted a new post!!!",
                Tags = new List<string>() { "tag" }
            };

            var httpResponse = this.httpServer.Post("api/posts", newPost, this.sessionKeyHeader);
            var postedPost = httpResponse.Content.ReadAsAsync<PostedPost>().Result;

            Assert.AreEqual(HttpStatusCode.Created, httpResponse.StatusCode);
            Assert.IsNotNull(httpResponse.Content);
            Assert.AreEqual(newPost.Title, postedPost.Title);
        }