public void SetModChannelAsync() { var mock = new Mock <IGuildData>(MockBehavior.Strict); mock.Setup(x => x.SetModChannelAsync(1, 2)).Returns(Task.CompletedTask); var guildService = new GuildService(mock.Object); guildService.SetModChannelAsync(1, 2); mock.Verify(x => x.SetModChannelAsync(1, 2), Times.Exactly(1)); }
public async Task SetModChannel(SocketTextChannel channel = null) { if (channel == null) { await ReplyAsync("Channel not specified"); return; } await LoggerExtensions.Log(Context.Guild, $"Mod channel set to {channel.Id}"); await _guildService.SetModChannelAsync(Context.Guild.Id, channel.Id); await ReplyAsync($"Mod channel set to {channel.Name}"); }