From b3322b117addd19fcd823ab069ee9250714f0d37 Mon Sep 17 00:00:00 2001 From: Jericho Date: Fri, 10 Jun 2022 21:24:12 -0400 Subject: [PATCH] =?UTF-8?q?=EF=BB=BF(GH-220)=20Integration=20tests=20for?= =?UTF-8?q?=20Contact=20Center?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestSuites/ApiTestSuite.cs | 1 + .../Tests/ContactCenter.cs | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Source/ZoomNet.IntegrationTests/Tests/ContactCenter.cs diff --git a/Source/ZoomNet.IntegrationTests/TestSuites/ApiTestSuite.cs b/Source/ZoomNet.IntegrationTests/TestSuites/ApiTestSuite.cs index 61dba1ec..76a1b5e7 100644 --- a/Source/ZoomNet.IntegrationTests/TestSuites/ApiTestSuite.cs +++ b/Source/ZoomNet.IntegrationTests/TestSuites/ApiTestSuite.cs @@ -13,6 +13,7 @@ internal class ApiTestSuite : TestSuite typeof(CallLogs), typeof(Chat), typeof(CloudRecordings), + typeof(ContactCenter), typeof(Contacts), typeof(Dashboards), typeof(Meetings), diff --git a/Source/ZoomNet.IntegrationTests/Tests/ContactCenter.cs b/Source/ZoomNet.IntegrationTests/Tests/ContactCenter.cs new file mode 100644 index 00000000..91a21bb4 --- /dev/null +++ b/Source/ZoomNet.IntegrationTests/Tests/ContactCenter.cs @@ -0,0 +1,26 @@ +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using ZoomNet.Models; + +namespace ZoomNet.IntegrationTests.Tests +{ + public class ContactCenter : IIntegrationTest + { + public async Task RunAsync(User myUser, string[] myPermissions, IZoomClient client, TextWriter log, CancellationToken cancellationToken) + { + if (cancellationToken.IsCancellationRequested) return; + + await log.WriteLineAsync("\n***** CONTACT CENTER *****\n").ConfigureAwait(false); + + var paginatedUserProfiles = await client.ContactCenter.SearchUserProfilesAsync("zzz", 10, null, cancellationToken).ConfigureAwait(false); + await log.WriteLineAsync($"Found {paginatedUserProfiles.TotalRecords} user profiles").ConfigureAwait(false); + + var user = await client.ContactCenter.CreateUserAsync("zzz@example.com", cancellationToken).ConfigureAwait(false); + await log.WriteLineAsync($"User {user.Id} created").ConfigureAwait(false); + + paginatedUserProfiles = await client.ContactCenter.SearchUserProfilesAsync("zzz", 10, null, cancellationToken).ConfigureAwait(false); + await log.WriteLineAsync($"Found {paginatedUserProfiles.TotalRecords} user profiles").ConfigureAwait(false); + } + } +}