public async Task DisposeAsync() { //clear up all the channels try { IReadOnlyCollection <string> channels = await _msg.ListChannelsAsync(); await _msg.DeleteChannelsAsync(channels); } catch { } }
/// <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)); }
public async Task Channels_delete_null_list_argument_exception() { await Assert.ThrowsAsync <ArgumentNullException>(() => _msg.DeleteChannelsAsync(null)); }