forked from ringcentral/ringcentral-csharp-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FaxTest.cs
37 lines (34 loc) · 1.19 KB
/
FaxTest.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
using System;
using System.Text;
using System.Threading;
using Xunit;
namespace RingCentral.Test
{
[Collection("RestClient collection")]
public class FaxTest : IDisposable
{
private RestClient rc;
public FaxTest(RestClientFixture fixture)
{
rc = fixture.rc;
}
[Fact]
public async void SendFax()
{
var extension = rc.Restapi().Account().Extension();
var attachment1 = new Attachment { fileName = "test.txt", contentType = "text/plain", bytes = Encoding.UTF8.GetBytes("hello world") };
var attachment2 = new Attachment { fileName = "test.png", contentType = "image/png", bytes = System.IO.File.ReadAllBytes("test.png") };
var attachments = new Attachment[] { attachment1, attachment2 };
var response = await extension.Fax().Post(new
{
to = new CallerInfo[] { new CallerInfo { phoneNumber = Config.Instance.receiver } }
}, attachments);
Assert.NotNull(response);
Assert.Equal("High", response.faxResolution);
}
public void Dispose()
{
Thread.Sleep(100);
}
}
}