-
Notifications
You must be signed in to change notification settings - Fork 25
/
MMSTest.cs
45 lines (41 loc) · 1.17 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
38
39
40
41
42
43
44
45
using System;
using System.IO;
using Xunit;
namespace RingCentral.Tests;
[Collection("Sequential")]
public class MmsTest
{
[Fact]
public async void SendMms()
{
var rc = await ReusableRestClient.GetInstance();
var extension = rc.Restapi().Account().Extension();
var attachments = new[]
{
new Attachment
{
filename = "rc.png",
contentType = "image/png",
content = File.ReadAllBytes("rc.png")
}
};
var messageInfo = await extension.Mms().Post(new CreateMMSMessage
{
from = new MessageStoreCallerInfoRequest
{
phoneNumber = Environment.GetEnvironmentVariable("RINGCENTRAL_SENDER")
},
to = new[]
{
new MessageStoreCallerInfoRequest
{
phoneNumber = Environment.GetEnvironmentVariable("RINGCENTRAL_RECEIVER")
}
},
text = "Hello world again",
attachments = attachments
});
Assert.NotNull(messageInfo);
Assert.Equal("SMS", messageInfo.type);
}
}