Ejemplo n.º 1
0
        public void CreateNewComment()
        {
            var content   = "Test Comment";
            var articleId = 1;
            var response  = ApiEndpoints.PostComment(articleId, content);

            Assert.Equal(content, response.Data.Content);
        }
Ejemplo n.º 2
0
        public void DeleteComment()
        {
            //Create comment
            var content          = "Test Comment";
            var articleId        = 1;
            var createdCommentId = ApiEndpoints.PostComment(articleId, content).Data.Id;

            //Delete comment
            var response = ApiEndpoints.DeleteComment(createdCommentId);

            Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
        }
Ejemplo n.º 3
0
        public void GetArticleWithNotExistingIdShouldReturn404()
        {
            var response = ApiEndpoints.GetArticle(999);

            Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
        }
Ejemplo n.º 4
0
        public void LoginWithCorrectUsernameAndPassword()
        {
            var response = ApiEndpoints.Login(Config.Username, Config.Password);

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
        }
Ejemplo n.º 5
0
        public void GetArticleWithExistingIdShouldReturn200()
        {
            var response = ApiEndpoints.GetArticle(1);

            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
        }