forked from ringcentral/RingCentral.Net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ServiceInfoTest.cs
38 lines (35 loc) · 1.4 KB
/
ServiceInfoTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Linq;
using Xunit;
namespace RingCentral.Tests
{
public class ServiceInfoTest
{
[Fact]
public async void ServiceInfo()
{
using (var rc = new RestClient(
Environment.GetEnvironmentVariable("RINGCENTRAL_CLIENT_ID"),
Environment.GetEnvironmentVariable("RINGCENTRAL_CLIENT_SECRET"),
Environment.GetEnvironmentVariable("RINGCENTRAL_SERVER_URL")
))
{
await rc.Authorize(
Environment.GetEnvironmentVariable("RINGCENTRAL_USERNAME"),
Environment.GetEnvironmentVariable("RINGCENTRAL_EXTENSION"),
Environment.GetEnvironmentVariable("RINGCENTRAL_PASSWORD")
);
// account service-info
var account = rc.Restapi().Account();
var accountServiceInfo = await account.ServiceInfo().Get();
var faxReceiving = accountServiceInfo.serviceFeatures.First(item => item.featureName == "FaxReceiving")
.enabled;
Assert.True(faxReceiving);
// meeting service-info
var meetingServiceInfo = await account.Extension().Meeting().ServiceInfo().Get();
Assert.NotNull(meetingServiceInfo);
Assert.StartsWith("http", meetingServiceInfo.uri);
}
}
}
}