Пример #1
0
        public async Task DisposeAsync()
        {
            //clear up all the channels

            try
            {
                IReadOnlyCollection <string> channels = await _msg.ListChannelsAsync();

                await _msg.DeleteChannelsAsync(channels);
            }
            catch { }
        }
Пример #2
0
 /// <summary>
 /// Deletes a single channel
 /// </summary>
 /// <param name="messenger"></param>
 /// <param name="channelName"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public static Task DeleteChannelAsync(this IMessenger messenger, string channelName, CancellationToken cancellationToken = default)
 {
     return(messenger.DeleteChannelsAsync(new[] { channelName }, cancellationToken));
 }
Пример #3
0
 public async Task Channels_delete_null_list_argument_exception()
 {
     await Assert.ThrowsAsync <ArgumentNullException>(() => _msg.DeleteChannelsAsync(null));
 }