public async Task CreateAsync_Test() { /* arrange */ string forumId = Guid.NewGuid().ToString("N"); string forumName = "Test Forum"; string forumDescription = "Test Description"; string forumGuidelines = "Test Guidelines"; string forumLanguage = "en"; var request = DisqusForumCreateRequest .New(forumName, forumId) .Attach(DisqusForumAttach.ForumForumCategory) .Guidelines(forumGuidelines) .Description(forumDescription) .Language(forumLanguage); /* act */ var response = await Disqus.Forums.CreateAsync(DisqusAccessToken.Create(TestData.AccessToken), request).ConfigureAwait(false); /* assert */ Assert.That(response.Code, Is.EqualTo(DisqusApiResponseCode.Success)); Assert.That(response.Response.Id, Is.EqualTo(forumId)); Assert.That(response.Response.Name, Is.EqualTo(forumName)); Assert.That(response.Response.RawDescription, Is.EqualTo(forumDescription)); Assert.That(response.Response.RawGuidelines, Is.EqualTo(forumGuidelines)); Assert.That(response.Response.Language, Is.EqualTo(forumLanguage)); }
public async Task <DisqusResponse <DisqusForum> > CreateAsync(DisqusAccessToken accessToken, DisqusForumCreateRequest request) { Collection <KeyValuePair <string, string> > parameters = Parameters .WithParameter("access_token", accessToken) .WithMultipleParameters(request.Parameters); return(await RequestProcessor .ExecuteAsync <DisqusResponse <DisqusForum> >(DisqusRequestMethod.Post, DisqusEndpoints.Forums.Create, parameters) .ConfigureAwait(false)); }