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

Comment_WhenPostExists_ShouldReturn201CodeAndEmptyContent() private method

        public void Comment_WhenPostExists_ShouldReturn201CodeAndEmptyContent()
        {
            // Add a post to test
            PostModel newPost = new PostModel()
            {
                Title = "Peshov post",
                Text = "Pesho posted a new post!!!"
            };

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

            CommentModel testComment = new CommentModel()
            {
                Text = "Test comment!"
            };
            
            var postID = postedPost.ID;
            var httpResponse = this.httpServer.Put("api/posts/" + postID + "/comment", testComment, this.sessionKeyHeader);

            Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
            Assert.IsNull(httpResponse.Content);
        }