Пример #1
0
        private async Task Add_And_Check_Recipient_UnitTest(string authKey, string listName)
        {
            Command addResponse;
            bool    checkResponse;
            var     firstIdentity  = Identity.Parse(RecipientIdentity);
            var     secondIdentity = Identity.Parse(RecipientIdentity + "1");

            if (authKey.Equals(""))
            {
                addResponse = await _broadcastService.AddRecipientAsync(listName, firstIdentity, CancellationToken.None, _logger);

                checkResponse = await _broadcastService.HasRecipientAsync(listName, firstIdentity, CancellationToken.None);
            }
            else
            {
                var broadcastService = new BroadcastService(authKey);
                addResponse = await broadcastService.AddRecipientAsync(listName, secondIdentity, CancellationToken.None, _logger);

                checkResponse = await broadcastService.HasRecipientAsync(listName, secondIdentity, CancellationToken.None);
            }

            addResponse.Status.ShouldBe(CommandStatus.Success);
            checkResponse.ShouldBeTrue();
        }