-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMMSTest.cs
37 lines (34 loc) · 1.09 KB
/
MMSTest.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.Threading;
using System.IO;
using Xunit;
namespace RingCentral.Test
{
[Collection("RestClient collection")]
public class MMSTest : IDisposable
{
private RestClient rc;
public MMSTest(RestClientFixture fixture)
{
rc = fixture.rc;
}
[Fact]
public async void SendMMS()
{
var extension = rc.Restapi().Account().Extension();
var attachment1 = new Attachment { fileName = "test.png", contentType = "image/png", bytes = System.IO.File.ReadAllBytes("test.png") };
var attachments = new Attachment[] { attachment1 };
var response = await extension.Sms().Post(new
{
to = new CallerInfo[] { new CallerInfo { phoneNumber = Config.Instance.receiver } },
from = new CallerInfo { phoneNumber = Config.Instance.username },
text = "Hello world again"
}, attachments);
Assert.NotNull(response);
}
public void Dispose()
{
Thread.Sleep(100);
}
}
}