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

Comment_WhenNullComment_ShouldReturn400ErrorResponse() private method

        public void Comment_WhenNullComment_ShouldReturn400ErrorResponse()
        {
            // 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;

            var postID = postedPost.ID;
            var httpResponse = this.httpServer.Put("api/posts/" + postID + "/comment", null, this.sessionKeyHeader);

            Assert.AreEqual(HttpStatusCode.BadRequest, httpResponse.StatusCode);
        }
    }