Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Merging cluster tests for orgs api #760

Merged
merged 7 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion test/Twilio.Test/ClusterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Twilio.Rest.Chat.V2;
using Twilio.Rest.Chat.V2.Service;
using Twilio.Rest.Events.V1;
using Twilio.Rest.PreviewIam;
using System.Linq;
namespace Twilio.Tests
{
Expand All @@ -17,6 +18,9 @@ class ClusterTest
private string apiKey;
string toNumber;
string fromNumber;
string orgsSid;
string clientId;
string clientSecret;
[SetUp]
[Category("ClusterTest")]
public void SetUp()
Expand All @@ -26,7 +30,11 @@ public void SetUp()
apiKey = Environment.GetEnvironmentVariable("TWILIO_API_KEY");
toNumber = Environment.GetEnvironmentVariable("TWILIO_TO_NUMBER");
fromNumber = Environment.GetEnvironmentVariable("TWILIO_FROM_NUMBER");
orgsSid = Environment.GetEnvironmentVariable("TWILIO_ORG_SID");
clientId = Environment.GetEnvironmentVariable("TWILIO_ORGS_CLIENT_ID");
clientSecret = Environment.GetEnvironmentVariable("TWILIO_ORGS_CLIENT_SECRET");
TwilioClient.Init(username:apiKey,password:secret,accountSid:accountSid);
TwilioOrgsTokenAuthClient.Init(clientId, clientSecret);
}


Expand Down Expand Up @@ -122,5 +130,18 @@ public void TestListParams()
Assert.True(SinkResource.Delete(sink.Sid));

}

[Test]
[Category("ClusterTest")]
public void TestFetchingOrgsAccounts()
{
Twilio.Base.BearerToken.TokenResourceSet<Twilio.Rest.PreviewIam.Organizations.AccountResource> accountList = null;
accountList = Twilio.Rest.PreviewIam.Organizations.AccountResource.Read(orgsSid);
Assert.IsNotNull(accountList.ElementAt(0).FriendlyName);

var userList = UserResource.Read(orgsSid);
Assert.IsNotNull(userList);

}
}
}
}
Loading