-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathCallLogTest.cs
More file actions
58 lines (51 loc) · 2.02 KB
/
Copy pathCallLogTest.cs
File metadata and controls
58 lines (51 loc) · 2.02 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using Xunit;
namespace RingCentral.Tests;
[Collection("Sequential")]
public class CallLogTest
{
[Fact]
public async void GetCallLogs()
{
var rc = await ReusableRestClient.GetInstance();
var callLogResponse = await rc.Restapi().Account().CallLog().List(new ReadCompanyCallLogParameters
{
perPage = 3,
dateFrom = DateTime.UtcNow.AddMonths(-6).ToString("o")
});
Assert.Equal(3, callLogResponse.records.Length);
}
[Fact]
public async void FilterByPhoneNumber()
{
var rc = await ReusableRestClient.GetInstance();
var callLogResponse = await rc.Restapi().Account().Extension().CallLog().List(
new ReadUserCallLogParameters
{
perPage = 1,
dateFrom = DateTime.UtcNow.AddMonths(-6).ToString("o"),
dateTo = DateTime.UtcNow.AddDays(-3)
.ToString("o") // don't want the very latest data because there might be sync issue
});
Assert.Single(callLogResponse.records);
// sometimes it doesn't work with the prefixing "+"
// sometimes it works, strange
// callLogResponse = await rc.Restapi().Account().Extension().CallLog().List(new ReadUserCallLogParameters
// {
// perPage = 1,
// dateFrom = DateTime.UtcNow.AddMonths(-6).ToString("o"),
// dateTo = DateTime.UtcNow.AddDays(-3).ToString("o"),
// phoneNumber = fromNumber // +123456789
// });
// Assert.Single(callLogResponse.records);
var firstRecord = callLogResponse.records[0];
callLogResponse = await rc.Restapi().Account().Extension().CallLog().List(new ReadUserCallLogParameters
{
perPage = 1,
dateFrom = DateTime.UtcNow.AddMonths(-6).ToString("o"),
dateTo = DateTime.UtcNow.AddDays(-3).ToString("o"),
telephonySessionId = firstRecord.telephonySessionId,
});
Assert.Single(callLogResponse.records);
}
}