-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMMSTest.cs
More file actions
62 lines (54 loc) · 1.67 KB
/
Copy pathMMSTest.cs
File metadata and controls
62 lines (54 loc) · 1.67 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
59
60
61
62
using System;
using System.IO;
using RingCentral.Net.Debug;
using Xunit;
using Xunit.Abstractions;
namespace RingCentral.Tests;
[Collection("Sequential")]
public class MmsTest
{
private readonly ITestOutputHelper _testOutputHelper;
public MmsTest(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
}
[Fact]
public async void SendMms()
{
var rc = await ReusableRestClient.GetInstance();
var debugExtension = new DebugExtension(new DebugOptions
{
// uncomment below to see detailed HTTP request/response
// loggingAction = s => { _testOutputHelper.WriteLine(s); }
});
await rc.InstallExtension(debugExtension);
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);
}
}