Esempio n. 1
0
    public void RemoveAllStrikesAsync()
    {
        var mock = new Mock <IStrikeData>(MockBehavior.Strict);

        mock.Setup(x => x.RemoveAllStrikesFromUserAsync(1, 2)).Returns(Task.CompletedTask);
        var guildService = new StrikeService(mock.Object);

        guildService.RemoveAllStrikesFromUserAsync(1, 2);

        mock.Verify(x => x.RemoveAllStrikesFromUserAsync(1, 2), Times.Exactly(1));
    }
Esempio n. 2
0
    public async Task RemoveAllStrikes(SocketUser user = null)
    {
        if (user == null)
        {
            await ReplyAsync("User not specified");

            return;
        }

        await Context.Message.DeleteAsync();

        await _strikesHandler.RemoveAllStrikesFromUserAsync(Context.Guild.Id, user.Id);

        await ReplyAsync($"Removed all of {user.Mention}'s strikes");
    }
Esempio n. 3
0
 private async Task RemoveAllStrikesFromUser(SocketUser user, SocketGuild guild)
 {
     await _strikeService.RemoveAllStrikesFromUserAsync(user.Id, guild.Id);
 }