Beispiel #1
0
 public async Task SendCoreAsync_Sends_Message_To_All_Recipients()
 {
     await RecipientTestHelper.AssertSendAsync(
         new AllMessageRecipient(),
         (sender, methodName, args) =>
         () => sender.SendAllExceptAsync(methodName, args, Array.Empty <string>(), CancellationToken.None));
 }
Beispiel #2
0
        public async Task SendCoreAsync_Sends_Message_To_Specified_Clients()
        {
            var connectionIds = new[] { "abcd", "efgh" };

            await RecipientTestHelper.AssertSendAsync(
                new ClientsMessageRecipient { ConnectionIds = connectionIds },
                (sender, methodName, args) =>
                () => sender.SendConnectionsAsync(connectionIds, methodName, args, CancellationToken.None));
        }
Beispiel #3
0
        public async Task SendCoreAsync_Sends_Message_To_All_Recipients_Except_Excluded_Connections()
        {
            var excludedConnectionIds = new[] { "abcd", "efgh" };

            await RecipientTestHelper.AssertSendAsync(
                new AllMessageRecipient { ExcludedConnectionIds = excludedConnectionIds },
                (sender, methodName, args) =>
                () => sender.SendAllExceptAsync(methodName, args, excludedConnectionIds, CancellationToken.None));
        }
        public async Task SendCoreAsync_Sends_Message_To_Specified_Client()
        {
            string connectionId = "abcd";

            await RecipientTestHelper.AssertSendAsync(
                new ClientMessageRecipient { ConnectionId = connectionId },
                (sender, methodName, args) =>
                () => sender.SendConnectionAsync(connectionId, methodName, args, CancellationToken.None));
        }
        public async Task SendCoreAsync_Sends_Message_To_Specified_Groups()
        {
            var groupNames = new[] { "abcd", "efgh" };

            await RecipientTestHelper.AssertSendAsync(
                new GroupsMessageRecipient { GroupNames = groupNames },
                (sender, methodName, args) =>
                () => sender.SendGroupsAsync(groupNames, methodName, args, CancellationToken.None));
        }
Beispiel #6
0
        public async Task SendCoreAsync_Sends_Message_To_Specified_Users()
        {
            var userIds = new[] { "abcd", "efgh" };

            await RecipientTestHelper.AssertSendAsync(
                new UsersMessageRecipient { UserIds = userIds },
                (sender, methodName, args) =>
                () => sender.SendUsersAsync(userIds, methodName, args, CancellationToken.None));
        }
        public async Task SendCoreAsync_Sends_Message_To_Specified_User()
        {
            string userId = "abcd";

            await RecipientTestHelper.AssertSendAsync(
                new UserMessageRecipient { UserId = userId },
                (sender, methodName, args) =>
                () => sender.SendUserAsync(userId, methodName, args, CancellationToken.None));
        }
Beispiel #8
0
        public async Task SendCoreAsync_Sends_Message_To_Specified_Group()
        {
            string groupName = "abcd";

            await RecipientTestHelper.AssertSendAsync(
                new GroupMessageRecipient { GroupName = groupName },
                (sender, methodName, args) =>
                () => sender.SendGroupExceptAsync(groupName, methodName, args, Array.Empty <string>(), CancellationToken.None));
        }
Beispiel #9
0
        public async Task SendCoreAsync_Sends_Message_To_Specified_Group_Except_Excluded_Connections()
        {
            string groupName             = "abcd";
            var    excludedConnectionIds = new[] { "abcd", "efgh" };

            await RecipientTestHelper.AssertSendAsync(
                new GroupMessageRecipient { GroupName = groupName, ExcludedConnectionIds = excludedConnectionIds },
                (sender, methodName, args) =>
                () => sender.SendGroupExceptAsync(groupName, methodName, args, excludedConnectionIds, CancellationToken.None));
        }