Esempio n. 1
0
 /// <summary>
 /// Mutes the specified enabled.
 /// </summary>
 /// <param name="enabled">if set to <c>true</c> [enabled].</param>
 public void Mute(bool enabled)
 {
     if (MuteCommand?.CanExecute(enabled) == true)
     {
         MuteCommand?.Execute(enabled);
     }
 }
Esempio n. 2
0
    public async Task ShouldReturnSuccessfulResult()
    {
        var command = new MuteCommand(ApplicationContext);
        var text    = command.Aliases[0];
        var message = GenerateMessage(DefaultUser.Id, DefaultUser.Id, text);

        var result = await command.Execute(message, DefaultUser);

        result.Should().BeOfType <SuccessfulResult>();
        result.Message.Should().NotBeNullOrEmpty();
        DefaultUser.IsErrorsEnabled.Should().BeFalse();
    }