예제 #1
0
 public void CanGetPost()
 {
     Post post = new Post { Title = postTitile, Details = postDetails, TopicId = Settings.Topic_ID };
     var res = api.HelpCenter.Posts.CreatePost(post);
     var get = api.HelpCenter.Posts.GetPost(res.Post.Id.Value);
     Assert.That(get.Post.Id, Is.EqualTo(res.Post.Id));
 }
예제 #2
0
        public void CanUpdatePost()
        {
            string updatedPostDetails = "This has been updated";
            Post post = new Post { Title = postTitile, Details = postDetails, TopicId = Settings.Topic_ID };
            var res = api.HelpCenter.Posts.CreatePost(post);

            res.Post.Details = updatedPostDetails;
            var updated = api.HelpCenter.Posts.UpdatePost(res.Post);

            Assert.That(updated?.Post, Is.Not.Null);
            Assert.That(updated.Post.Details, Is.EqualTo(updatedPostDetails));
        }
예제 #3
0
 public async Task<IndividualPostResponse> CreatePostAsync(Post post)
 {
     var body = new { post };
     return await GenericPostAsync<IndividualPostResponse>("community/posts.json", body);
 }
예제 #4
0
 public IndividualPostResponse UpdatePost(Post post)
 {
     var body = new { post };
     return GenericPut<IndividualPostResponse>(string.Format("community/posts/{0}.json", post.Id.Value), body);
 }
예제 #5
0
 public IndividualPostResponse CreatePost(Post post)
 {
     var body = new { post };
     return GenericPost<IndividualPostResponse>("community/posts.json", body);
 }
예제 #6
0
 public async Task<IndividualPostResponse> UpdatePostAsync(Post post)
 {
     var body = new { post };
     return await GenericPutAsync<IndividualPostResponse>(string.Format("community/posts/{0}.json", post.Id.Value), body);
 }
예제 #7
0
 public async Task CanDeletePostAsync()
 {
     Post post = new Post { Title = postTitile, Details = postDetails, TopicId = Settings.Topic_ID };
     var res = await api.HelpCenter.Posts.CreatePostAsync(post);
     Assert.That( await api.HelpCenter.Posts.DeletePostAsync(res.Post.Id.Value), Is.True);
 }
예제 #8
0
 public async Task CanCreatePostAsync()
 {
     Post post = new Post { Title = postTitile, Details = postDetails, TopicId = Settings.Topic_ID };
     var res = await api.HelpCenter.Posts.CreatePostAsync(post);
     Assert.That(res?.Post, Is.Not.Null);
 }