示例#1
0
    public void RemoveStrikeAsync()
    {
        var mock = new Mock <IStrikeData>(MockBehavior.Strict);

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

        guildService.RemoveStrikeAsync(1, 2);

        mock.Verify(x => x.RemoveStrikeAsync(1, 2), Times.Exactly(1));
    }
示例#2
0
    public async Task RemoveStrikes(int?strikeId = null)
    {
        if (strikeId == null)
        {
            await ReplyAsync("Strike id not specified");

            return;
        }
        await _strikesHandler.RemoveStrikeAsync(Context.Guild.Id, (int)strikeId);

        await ReplyAsync("strike removed");
    }