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

Create_WhenValidPostWithoutTags_ShouldReturn201CodeAndNotNullContent() private method

        public void Create_WhenValidPostWithoutTags_ShouldReturn201CodeAndNotNullContent()
        {
            PostModel newPost = new PostModel()
            {
                Title = "Peshov post",
                Text = "Pesho posted a new post!!!"
            };

            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(postedPost);
            Assert.AreEqual(newPost.Title, postedPost.Title);
        }