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)); }
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)); }
public async Task<IndividualPostResponse> CreatePostAsync(Post post) { var body = new { post }; return await GenericPostAsync<IndividualPostResponse>("community/posts.json", body); }
public IndividualPostResponse UpdatePost(Post post) { var body = new { post }; return GenericPut<IndividualPostResponse>(string.Format("community/posts/{0}.json", post.Id.Value), body); }
public IndividualPostResponse CreatePost(Post post) { var body = new { post }; return GenericPost<IndividualPostResponse>("community/posts.json", body); }
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); }
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); }
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); }