forked from Inumedia/SlackAPI
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJoinDirectMessageChannel.cs
More file actions
44 lines (38 loc) · 1.25 KB
/
Copy pathJoinDirectMessageChannel.cs
File metadata and controls
44 lines (38 loc) · 1.25 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
using System;
using System.Linq;
using SlackAPI.Tests.Configuration;
using SlackAPI.Tests.Helpers;
using Xunit;
namespace SlackAPI.Tests
{
[Collection("Integration tests")]
public class JoinDirectMessageChannel
{
private readonly IntegrationFixture fixture;
public JoinDirectMessageChannel(IntegrationFixture fixture)
{
this.fixture = fixture;
}
[Fact]
public void ShouldJoinDirectMessageChannel()
{
// given
var client = this.fixture.UserClient;
JoinDirectMessageChannelResponse actual = null;
string userName = this.fixture.Config.DirectMessageUser;
string user = client.Users.First(x => x.name.Equals(userName, StringComparison.OrdinalIgnoreCase)).id;
// when
using (var sync = new InSync(nameof(SlackClient.JoinDirectMessageChannel)))
{
client.JoinDirectMessageChannel(response =>
{
actual = response;
sync.Proceed();;
}, user);
}
// then
Assert.True(actual.ok, "Error while joining user channel");
Assert.NotEmpty(actual.channel.id);
}
}
}