-
Notifications
You must be signed in to change notification settings - Fork 238
Expand file tree
/
Copy pathPresenceSub.cs
More file actions
41 lines (35 loc) · 1.1 KB
/
PresenceSub.cs
File metadata and controls
41 lines (35 loc) · 1.1 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
using SlackAPI.Tests.Configuration;
using SlackAPI.Tests.Helpers;
using System.Linq;
using Xunit;
namespace SlackAPI.Tests
{
[Collection("Integration tests")]
public class PresenceSub
{
private readonly IntegrationFixture fixture;
public PresenceSub(IntegrationFixture fixture)
{
this.fixture = fixture;
}
[Fact]
public void PresenceSubscribe()
{
var client = this.fixture.UserClientWithPresence;
var directMessageUser = client.Users.FirstOrDefault(x => x.name == this.fixture.Config.DirectMessageUser);
Assert.NotNull(directMessageUser);
//UserListResponse actual = null;
using (var sync = new InSync(nameof(SlackClient.UserLookup)))
{
client.OnPresenceChangeReceived += (user) =>
{
};
client.OnUserChangeReceived += (user) =>
{
};
client.SendPresenceSub(new[] { directMessageUser.id });
sync.Proceed();
}
}
}
}