/// <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); } }
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(); }