Skip to content

Commit

Permalink
feat: Merging cluster tests for orgs api (#760)
Browse files Browse the repository at this point in the history
* Merging cluster tests for orgs api
  • Loading branch information
AsabuHere authored Sep 25, 2024
1 parent ad16eae commit 0320ebd
Showing 1 changed file with 22 additions and 1 deletion.
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);

}
}
}
}

0 comments on commit 0320ebd

Please sign in to comment.