public void CanCreateUpdateAndDeleteTopic()
        {
            Topic topic = new Topic { Name = "This is a Test" };

            var res = api.HelpCenter.Topics.CreateTopic(topic);
            Assert.That(res?.Topic, Is.Not.Null);

            res.Topic.Description = "More Testing";
            var update = api.HelpCenter.Topics.UpdateTopic(res.Topic).Topic;
            Assert.That(update.Description, Is.EqualTo("More Testing"));

            Assert.That(api.HelpCenter.Topics.DeleteTopic(res.Topic.Id.Value), Is.True);
        }
Exemple #2
0
 public async Task<IndividualTopicResponse> UpdateTopicAsync(Topic topic)
 {
     var body = new { topic };
     return await GenericPutAsync<IndividualTopicResponse>(string.Format("community/topics/{0}.json", topic.Id.Value), body);
 }
Exemple #3
0
 public IndividualTopicResponse UpdateTopic(Topic topic)
 {
     var body = new { topic };
     return GenericPut<IndividualTopicResponse>(string.Format("community/topics/{0}.json", topic.Id.Value), body);
 }
Exemple #4
0
        public async Task<IndividualTopicResponse> CreateTopicAsync(Topic topic)
        {
            var body = new { topic };
            return await GenericPostAsync<IndividualTopicResponse>("community/topics.json", body);

        }
Exemple #5
0
 public IndividualTopicResponse CreateTopic(Topic topic)
 {
     var body = new { topic };
     return GenericPost<IndividualTopicResponse>("community/topics.json", body);
 }