Exemplo n.º 1
0
    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));
    }
Exemplo n.º 2
0
    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}");
    }