-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathActionsBlockFixtures.cs
More file actions
38 lines (35 loc) · 1.05 KB
/
ActionsBlockFixtures.cs
File metadata and controls
38 lines (35 loc) · 1.05 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
using System.Collections.Generic;
using FluentAssertions;
using Slack.Webhooks.Api;
using Slack.Webhooks.Blocks;
using Slack.Webhooks.Elements;
using Slack.Webhooks.Interfaces;
using Xunit;
namespace Slack.Webhooks.Tests
{
public class ActionsBlockFixtures
{
[Fact]
public void ShouldSerializeActionElements()
{
// arrange
var elementList = new List<IActionElement>
{
new Button(),
new SelectChannels(),
new SelectConversations(),
new SelectExternal(),
new SelectStatic(),
new SelectUsers(),
new Overflow(),
new DatePicker()
};
var actions = new Actions { Elements = elementList };
// act
var elementListPayload = ApiBase.SerializeObject(elementList);
var payload = ApiBase.SerializeObject(actions);
// assert
payload.Should().Contain($"\"elements\":{elementListPayload}");
}
}
}